X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/5c9f46613a83ebfc29a5b1f099448259e96a98f0..d26ffc64f583ab2d29df48f13518685602bc8832:/osfmk/arm/machine_routines.h?ds=sidebyside diff --git a/osfmk/arm/machine_routines.h b/osfmk/arm/machine_routines.h index 3e46c61e1..cee6477b1 100644 --- a/osfmk/arm/machine_routines.h +++ b/osfmk/arm/machine_routines.h @@ -629,6 +629,26 @@ struct perfcontrol_work_interval { }; 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. @@ -727,6 +747,11 @@ typedef void (*sched_perfcontrol_max_runnable_latency_t)(perfcontrol_max_runnabl */ 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. @@ -778,7 +803,6 @@ typedef void (*sched_perfcontrol_state_update_t)( 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 @@ -794,6 +818,7 @@ typedef void (*sched_perfcontrol_state_update_t)( #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 { @@ -809,6 +834,7 @@ 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;