};
typedef struct perfcontrol_work_interval *perfcontrol_work_interval_t;
+typedef enum {
+ WORK_INTERVAL_START,
+ WORK_INTERVAL_UPDATE,
+ WORK_INTERVAL_FINISH
+} work_interval_ctl_t;
+
+struct perfcontrol_work_interval_instance {
+ work_interval_ctl_t ctl;
+ uint32_t create_flags;
+ uint64_t complexity;
+ uint64_t thread_id;
+ uint64_t work_interval_id;
+ uint64_t instance_id; /* out: start, in: update/finish */
+ uint64_t start;
+ uint64_t finish;
+ uint64_t deadline;
+ uint64_t thread_group_id;
+ void *thread_group_data;
+};
+typedef struct perfcontrol_work_interval_instance *perfcontrol_work_interval_instance_t;
/*
* Structure to export per-CPU counters as part of the CLPC callout.
*/
typedef void (*sched_perfcontrol_work_interval_notify_t)(perfcontrol_state_t, perfcontrol_work_interval_t);
+/*
+ * Start, update and finish work interval instance with optional complexity estimate.
+ */
+typedef void (*sched_perfcontrol_work_interval_ctl_t)(perfcontrol_state_t, perfcontrol_work_interval_instance_t);
+
/*
* These callbacks are used when thread groups are added, removed or properties
* updated.
perfcontrol_event event, uint32_t cpu_id, uint64_t timestamp, uint32_t flags,
struct perfcontrol_thread_data *thr_data, __unused void *unused);
-
/*
* Callers should always use the CURRENT version so that the kernel can detect both older
* and newer structure layouts. New callbacks should always be added at the end of the
#define SCHED_PERFCONTROL_CALLBACKS_VERSION_4 (4) /* up-to deadline_passed */
#define SCHED_PERFCONTROL_CALLBACKS_VERSION_5 (5) /* up-to state_update */
#define SCHED_PERFCONTROL_CALLBACKS_VERSION_6 (6) /* up-to thread_group_flags_update */
+#define SCHED_PERFCONTROL_CALLBACKS_VERSION_7 (7) /* up-to work_interval_ctl */
#define SCHED_PERFCONTROL_CALLBACKS_VERSION_CURRENT SCHED_PERFCONTROL_CALLBACKS_VERSION_6
struct sched_perfcontrol_callbacks {
sched_perfcontrol_csw_t csw;
sched_perfcontrol_state_update_t state_update;
sched_perfcontrol_thread_group_flags_update_t thread_group_flags_update;
+ sched_perfcontrol_work_interval_ctl_t work_interval_ctl;
};
typedef struct sched_perfcontrol_callbacks *sched_perfcontrol_callbacks_t;