Skip to main content

VTable

Struct VTable 

Source
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,
}
Available on macOS only.
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:

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

Implementations§

Source§

impl VTable

Source

pub fn load(handle: &LibraryHandle) -> Result<Self, LoadError>

Resolves every kperf.framework symbol from handle.

Resolution is all-or-nothing: if any of the 34 required symbols cannot be found, the call returns an error.

§Errors

Returns LoadError if any symbol cannot be resolved from the framework.

Trait Implementations§

Source§

impl Debug for VTable

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.