X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/c18c124eaa464aaaa5549e99e5a70fc9cbb50944..3e170ce000f1506b7b5d2c5c7faec85ceabb573d:/osfmk/kern/kpc_thread.c diff --git a/osfmk/kern/kpc_thread.c b/osfmk/kern/kpc_thread.c index 692aa02fe..1ac250c39 100644 --- a/osfmk/kern/kpc_thread.c +++ b/osfmk/kern/kpc_thread.c @@ -33,11 +33,17 @@ #include #include +#include +#include +#include +#include +#include +#include #include /* global for whether to read PMCs on context switch */ -int kpc_threads_counting; +int kpc_threads_counting = 0; /* current config and number of counters in that config */ static uint32_t kpc_thread_classes = 0; @@ -47,8 +53,6 @@ static lck_grp_attr_t *kpc_thread_lckgrp_attr = NULL; static lck_grp_t *kpc_thread_lckgrp = NULL; static lck_mtx_t kpc_thread_lock; -void kpc_thread_init(void); - void kpc_thread_init(void) { @@ -112,6 +116,7 @@ kpc_set_thread_counting(uint32_t classes) } } + kperf_kpc_cswitch_callback_update(); lck_mtx_unlock(&kpc_thread_lock); return 0; @@ -125,12 +130,7 @@ kpc_update_thread_counters( thread_t thread ) uint64_t *tmp = NULL; cpu_data_t *cpu = NULL; -/* TODO: Fix this...*/ -#if defined (__x86_64__) cpu = current_cpu_datap(); -#else -#error architecture not yet supported -#endif /* 1. stash current PMCs into latest CPU block */ kpc_get_cpu_counters( FALSE, kpc_thread_classes,