• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/xnu-2782.1.97/osfmk/pmc/

Lines Matching defs:pmc

88 typedef kern_return_t (*perfmon_get_accessible_cores_method_t)(pmc_object_t pmc, uint32_t **cores, size_t *coreCt);
150 * @param pmc A valid pmc object
153 typedef pmc_config_object_t (*pmc_create_config_method_t)(pmc_object_t pmc);
156 * @abstract A pointer to a method to free a configuration object for a pmc
157 * @discussion Method should free a pmc config object created with a pmc_create_config_method_t above
158 * @param pmc The pmc object used to create the config
161 typedef void (*pmc_free_config_method_t)(pmc_object_t pmc, pmc_config_object_t config);
165 * @discussion Configuration objects take key-value pairs for setting various bits in the pmc configs
200 * @abstract A pointer to a method that will configure a pmc's control registers according to the given configuration object.
202 * @param pmc The pmc reference object.
205 typedef kern_return_t (*pmc_set_config_method_t)(pmc_object_t pmc, pmc_config_object_t config);
212 * @param pmc A valid pmc object
215 typedef perf_monitor_object_t (*pmc_get_monitor_method_t)(pmc_object_t pmc);
225 * @param pmc A valid pmc object.
226 * @result NULL on failure, or a pointer to the registered name of the pmc.
228 typedef const char *(*pmc_get_name_method_t)(pmc_object_t pmc);
231 * @abstract A pointer to a method that returns if a pmc is accessible from a given logical core.
232 * @discussion A pointer to a method that returns if a pmc is accessible from a given logical core.
234 * @param pmc A valid pmc object.
236 * @result TRUE if the pmc can be read in the execution context of the given logical core, FALSE otherwise.
238 typedef boolean_t (*pmc_is_accessible_from_logical_core_method_t)(pmc_object_t pmc, uint32_t core);
245 * @param pmc A valid pmc object
250 typedef kern_return_t (*pmc_get_accessible_cores_method_t)(pmc_object_t pmc, uint32_t **cores, size_t *coreCt);
254 * @discussion Implementations of this method type must be safe to call from interrupt context. * @param pmc The counter from which to read
257 typedef kern_return_t (*pmc_get_count_method_t)(pmc_object_t pmc, uint64_t *value);
262 * @param pmc The counter to which to write.
265 typedef kern_return_t (*pmc_set_count_method_t)(pmc_object_t pmc, uint64_t value);
273 * @param pmc A valid pmc object.
276 typedef kern_return_t (*pmc_disable_method_t)(pmc_object_t pmc);
282 * @param pmc A valid pmc object.
285 typedef kern_return_t (*pmc_enable_method_t)(pmc_object_t pmc);
287 typedef kern_return_t (*pmc_open_method_t)(pmc_object_t pmc, void *object);
288 typedef kern_return_t (*pmc_close_method_t)(pmc_object_t pmc, void *object);
373 * that will be accessed with the given set of pmc methods.
375 * @param pmc A handle to the Performance Counter instance to be attached to the monitor object
383 kern_return_t pmc_register(perf_monitor_object_t monitor, pmc_object_t pmc,
389 * @param monitor The registered Performance Monitor from which to remove a pmc.
390 * @param pmc The Performance Counter to unregister.
395 kern_return_t pmc_unregister(perf_monitor_object_t monitor, pmc_object_t pmc);
434 /*!struct pmc
437 typedef struct pmc {
527 pmc_t pmc; // Pointer to in-kernel pmc which is reserved
553 * @abstract Creates a new configuration object for the given pmc.
555 * @param pmc The Perf Counter for which to create a configuration.
558 kern_return_t pmc_create_config(pmc_t pmc, pmc_config_t *config);
561 * @abstract Releases a configuration object for the given pmc.
563 * @param pmc The Perf Counter for which to release a configuration.
566 void pmc_free_config(pmc_t pmc, pmc_config_t config);
574 kern_return_t pmc_config_set_value(pmc_t pmc, pmc_config_t config, uint8_t id, uint64_t value);
579 * called after the interrupt occurs, along with a reference context. PMC Threshold handler methods will have the pmc that generated the interrupt as
582 kern_return_t pmc_config_set_interrupt_threshold(pmc_t pmc, pmc_config_t config, uint64_t threshold, pmc_interrupt_method_t method, void *refCon);
611 * @abstract Returns a pointer to the human-readable name of the given pmc.
613 * @param pmc The PMC whose name should be returned.
615 const char *pmc_get_name(pmc_t pmc);
618 * @abstract Returns a list of logical cores from which the given pmc can be read from or written to.
619 * @discussion This method can return a NULL list with count of 0 -- this indicates any core can read the given pmc. This method does not allocate the list,
621 * @param pmc The PMC for which to return the cores that can read/write it.
623 * @param logicalCoreCt Value-return number of elements in the returned list. 0 indicates all cores can read/write the given pmc.
625 kern_return_t pmc_get_accessible_core_list(pmc_t pmc, uint32_t **logicalCores, size_t *logicalCoreCt);
636 * @discussion This method will attempt to reserve the given pmc at system-scope. It will configure the given pmc to count the event indicated by the given
639 * @param pmc The PMC to reserve.
640 * @param config The configuration object to use with the given pmc.
643 * KERN_SUCCESS: The given pmc was successfully reserved in system-scope; the given config object has been consumed and should not be freed by the caller,
644 * KERN_FAILURE: The given pmc is already reserved in a conflicting scope,
648 kern_return_t pmc_reserve(pmc_t pmc, pmc_config_t config, pmc_reservation_t *reservation);
653 * @discussion This method will attempt to reserve the given pmc for task-wide counting. The resulting reservation will only count when the task is running
654 * on one of the logical cores that can read the given pmc. The semantics of this method are the same as <link>pmc_reserve</link> in all other respects.
655 * @param pmc The PMC to reserve
661 kern_return_t pmc_reserve_task(pmc_t pmc, pmc_config_t config, task_t task, pmc_reservation_t *reservation);
665 * @discussion This method will attempt to reserve the given pmc for thread-wide counting. The resulting reservation will only count when the thread is
666 * running on one of the logical cores that can read the given pmc. The semantics of this method are the same as <link>pmc_reserve_task</link> in all other respects.
667 * @param pmc The PMC to reserve
673 kern_return_t pmc_reserve_thread(pmc_t pmc, pmc_config_t config, thread_t thread, pmc_reservation_t *reservation);
678 * current thread, or for a pmc that is not accessible from the current logical core, the reservation will start counting the next time the thread (or task)
679 * runs on a logical core than can access the pmc. This method is interrupt safe. If this method is called from outside of interrupt context, it may block.
687 * current thread, or for a pmc that is not accessible from the current logical core, the reservation will stop counting the next time the thread (or task) c
688 * eases to run on a logical core than can access the pmc. This method is interrupt safe. If called form outside of interrupt context, this method may block.
695 * @discussion This method will read the event count associated with the given reservation. If the pmc is currently on hardware, and the caller is currently ]
696 * executing in a context that both a) matches the reservation's context, and b) can access the reservation's pmc directly, the value will be read directly
706 * @discussion This method will write the event count associated with the given reservation. If the pmc is currently on hardware, and the caller is currently
707 * executing in a context that both a) matches the reservation's context, and b) can access the reservation's pmc directly, the value will be written directly
726 * @abstract Brings up all the necessary infrastructure required to use the pmc sub-system.
732 * @abstract Performs a pmc context switch.
757 * of t_chud (for the pmc flag) for all threads in that task. Consequently, we can simply check the current thread's flag against THREAD_PMC_FLAG.