Interface for trackers. This is a generic interface implemented by all trackers, regardless of what it is that they track.
Typically, the things being tracked (the trackees) are processes. The tracker keeps track of what trackee is active on what processor; this is useful when one wants to observe one specific trackee and disregard the others. Trackees are identified by a unique integer called a tid (Trackee ID).
typedef struct { integer_t (*active_trackee)(conf_object_t *NOTNULL tracker, conf_object_t *NOTNULL cpu); const char *(*describe_trackee)(conf_object_t *NOTNULL tracker, integer_t tid); attr_value_t (*processor_list)(conf_object_t *NOTNULL tracker); void (*add_processor)(conf_object_t *NOTNULL tracker, conf_object_t *NOTNULL cpu); void (*remove_processor)(conf_object_t *NOTNULL tracker, conf_object_t *NOTNULL cpu); int (*supports_processor)(const char *NOTNULL classname); int (*activate)(conf_object_t *NOTNULL tracker); int (*deactivate)(conf_object_t *NOTNULL tracker); } tracker_interface_t; #define TRACKER_INTERFACE "tracker"
active_trackee returns the tid of the trackee that is currently active on the given processor. describe_trackee returns a short string that describes the trackee with the given tid.
processor_list returns the set of processors being watched by the tracker. add_processor and remove_processor add and remove a processor from this set, respectively.
supports_processor returns true if trackers of this type support processors of the given class, and false otherwise.
Before using the tracker, call activate. When you are done with it, call deactivate.
In addition to these interface functions, the tracker should trigger the Core_Trackee_Active hap when the active trackee changes for a processor.
activate | activate tracker |
add-processor | track processes on this processor |
deactivate | deactivate tracker |
remove-processor | do not track processes on this processor |