Lines Matching refs:monitor
365 /* If this flag is set, the monitor is already validated to be
464 static perf_monitor_t perf_monitor_find(perf_monitor_object_t monitor) {
465 assert(monitor);
472 if(element->object == monitor) {
485 * perf_monitor_add_pmc adds a newly registered PMC to the perf monitor it is
499 * monitor it is associated with.
528 pmc->monitor = NULL;
1517 perf_monitor_t store_pm = store_pmc->monitor;
1570 perf_monitor_t load_pm = load_pmc->monitor;
1760 kern_return_t perf_monitor_register(perf_monitor_object_t monitor,
1764 COUNTER_DEBUG("registering perf monitor %p\n", monitor);
1766 if(!monitor || !methods) {
1775 /* If the monitor requires idle notifications, ensure that it is
1782 if (KERN_SUCCESS == methods->accessible_cores(monitor, &cores, &core_cnt)) {
1803 perf_monitor_t dupe = perf_monitor_find(monitor);
1805 COUNTER_DEBUG("Duplicate registration for %p\n", monitor);
1819 pm->object = monitor;
1836 kern_return_t perf_monitor_unregister(perf_monitor_object_t monitor) {
1839 COUNTER_DEBUG("unregistering perf monitor %p\n", monitor);
1841 if(!monitor) {
1845 perf_monitor_t pm = perf_monitor_find(monitor);
1873 * NOTE: @monitor must have been successfully registered via
1876 kern_return_t pmc_register(perf_monitor_object_t monitor, pmc_object_t pmc_object,
1879 COUNTER_DEBUG("%p %p\n", monitor, pmc_object);
1881 if(!monitor || !pmc_object || !methods || !object) {
1911 /* make sure this perf monitor object is already registered */
1916 perf_monitor_t pm = perf_monitor_find(monitor);
1918 COUNTER_DEBUG("Could not find perf monitor for %p\n", monitor);
1939 pmc->monitor = pm;
1941 perf_monitor_add_pmc(pmc->monitor, pmc);
1957 kern_return_t pmc_unregister(perf_monitor_object_t monitor, pmc_object_t pmc_object) {
1958 COUNTER_DEBUG("%p %p\n", monitor, pmc_object);
1960 if(!monitor || !pmc_object) {
1973 perf_monitor_remove_pmc(pmc->monitor, pmc);
1984 static void perf_monitor_reservation_add(perf_monitor_t monitor) {
1985 assert(monitor);
1986 OSIncrementAtomic(&(monitor->reservedCounters));
1989 static void perf_monitor_reservation_remove(perf_monitor_t monitor) {
1990 assert(monitor);
1991 OSDecrementAtomic(&(monitor->reservedCounters));
2391 perf_monitor_reservation_add(pmc->monitor);
2419 if (!(pmc->monitor->methods.flags & PERFMON_FLAG_SUPPORTS_CONTEXT_SWITCHING)) {
2450 perf_monitor_reservation_add(pmc->monitor);
2477 if (!(pmc->monitor->methods.flags & PERFMON_FLAG_SUPPORTS_CONTEXT_SWITCHING)) {
2508 perf_monitor_reservation_add(pmc->monitor);
2709 perf_monitor_reservation_remove(reservation->pmc->monitor);
2744 perf_monitor_t monitor = NULL;
2752 queue_iterate(cpu_queue, monitor, perf_monitor_t, cpu_link) {
2753 perf_monitor_methods_t *methods = &(monitor->methods);
2754 if ((methods->flags & PERFMON_FLAG_ALWAYS_ACTIVE) || (monitor->reservedCounters)) {
2755 methods->on_idle(monitor->object);
2769 perf_monitor_t monitor = NULL;
2777 queue_iterate(cpu_queue, monitor, perf_monitor_t, cpu_link) {
2778 perf_monitor_methods_t *methods = &(monitor->methods);
2779 if ((methods->flags & PERFMON_FLAG_ALWAYS_ACTIVE) || (monitor->reservedCounters)) {
2780 methods->on_idle_exit(monitor->object);
2855 kern_return_t perf_monitor_register(perf_monitor_object_t monitor __unused,
2860 kern_return_t perf_monitor_unregister(perf_monitor_object_t monitor __unused) {
2864 kern_return_t pmc_register(perf_monitor_object_t monitor __unused,
2869 kern_return_t pmc_unregister(perf_monitor_object_t monitor __unused,