pub struct VTable {Show 34 fields
pub kpc_cpu_string: kpc_cpu_string,
pub kpc_pmu_version: kpc_pmu_version,
pub kpc_get_counting: kpc_get_counting,
pub kpc_set_counting: kpc_set_counting,
pub kpc_get_thread_counting: kpc_get_thread_counting,
pub kpc_set_thread_counting: kpc_set_thread_counting,
pub kpc_get_config_count: kpc_get_config_count,
pub kpc_get_counter_count: kpc_get_counter_count,
pub kpc_get_config: kpc_get_config,
pub kpc_set_config: kpc_set_config,
pub kpc_get_cpu_counters: kpc_get_cpu_counters,
pub kpc_get_thread_counters: kpc_get_thread_counters,
pub kpc_force_all_ctrs_set: kpc_force_all_ctrs_set,
pub kpc_force_all_ctrs_get: kpc_force_all_ctrs_get,
pub kperf_action_count_set: kperf_action_count_set,
pub kperf_action_count_get: kperf_action_count_get,
pub kperf_action_samplers_set: kperf_action_samplers_set,
pub kperf_action_samplers_get: kperf_action_samplers_get,
pub kperf_action_filter_set_by_task: kperf_action_filter_set_by_task,
pub kperf_action_filter_set_by_pid: kperf_action_filter_set_by_pid,
pub kperf_timer_count_set: kperf_timer_count_set,
pub kperf_timer_count_get: kperf_timer_count_get,
pub kperf_timer_period_set: kperf_timer_period_set,
pub kperf_timer_period_get: kperf_timer_period_get,
pub kperf_timer_action_set: kperf_timer_action_set,
pub kperf_timer_action_get: kperf_timer_action_get,
pub kperf_timer_pet_set: kperf_timer_pet_set,
pub kperf_timer_pet_get: kperf_timer_pet_get,
pub kperf_sample_set: kperf_sample_set,
pub kperf_sample_get: kperf_sample_get,
pub kperf_reset: kperf_reset,
pub kperf_ns_to_ticks: kperf_ns_to_ticks,
pub kperf_ticks_to_ns: kperf_ticks_to_ns,
pub kperf_tick_frequency: kperf_tick_frequency,
}Expand description
Eagerly-resolved function pointers for kperf.framework.
Each field is a C function pointer obtained via dlsym from Apple’s private
kperf.framework. The framework exposes two subsystems:
-
KPC (Kernel Performance Counters): enabling counter classes (
kpc_set_counting), programming hardware registers (kpc_set_config), reading per-thread or per-CPU accumulations (kpc_get_thread_counters,kpc_get_cpu_counters), and force-acquiring counters from the Power Manager (kpc_force_all_ctrs_set). -
KPERF (Kernel Performance): the sampling subsystem that fires actions on timer triggers (
kperf_action_samplers_set,kperf_timer_period_set), with tick/nanosecond conversion helpers (kperf_ns_to_ticks,kperf_ticks_to_ns).
All function pointers are resolved eagerly by load. If any
symbol is missing from the framework, loading fails immediately rather than
deferring to first use. The resolved pointers remain valid for as long as
the originating LibraryHandle is open.
§Safety
Every field is an unsafe extern "C" fn. The caller is responsible for
upholding the preconditions documented on each function pointer type alias:
buffer sizes, pointer validity, and privilege requirements. Most KPC/KPERF
calls require root privileges.
Fields§
§kpc_cpu_string: kpc_cpu_string§kpc_pmu_version: kpc_pmu_version§kpc_get_counting: kpc_get_counting§kpc_set_counting: kpc_set_counting§kpc_get_thread_counting: kpc_get_thread_counting§kpc_set_thread_counting: kpc_set_thread_counting§kpc_get_config_count: kpc_get_config_count§kpc_get_counter_count: kpc_get_counter_count§kpc_get_config: kpc_get_config§kpc_set_config: kpc_set_config§kpc_get_cpu_counters: kpc_get_cpu_counters§kpc_get_thread_counters: kpc_get_thread_counters§kpc_force_all_ctrs_set: kpc_force_all_ctrs_set§kpc_force_all_ctrs_get: kpc_force_all_ctrs_get§kperf_action_count_set: kperf_action_count_set§kperf_action_count_get: kperf_action_count_get§kperf_action_samplers_set: kperf_action_samplers_set§kperf_action_samplers_get: kperf_action_samplers_get§kperf_action_filter_set_by_task: kperf_action_filter_set_by_task§kperf_action_filter_set_by_pid: kperf_action_filter_set_by_pid§kperf_timer_count_set: kperf_timer_count_set§kperf_timer_count_get: kperf_timer_count_get§kperf_timer_period_set: kperf_timer_period_set§kperf_timer_period_get: kperf_timer_period_get§kperf_timer_action_set: kperf_timer_action_set§kperf_timer_action_get: kperf_timer_action_get§kperf_timer_pet_set: kperf_timer_pet_set§kperf_timer_pet_get: kperf_timer_pet_get§kperf_sample_set: kperf_sample_set§kperf_sample_get: kperf_sample_get§kperf_reset: kperf_reset§kperf_ns_to_ticks: kperf_ns_to_ticks§kperf_ticks_to_ns: kperf_ticks_to_ns§kperf_tick_frequency: kperf_tick_frequency