Function pmu_x86::start_samples
source · pub fn start_samples(
event_type: EventType,
event_per_sample: u32,
task_id: Option<usize>,
sample_count: u32
) -> Result<(), &'static str>
Expand description
Start interrupt process in order to take samples using the PMU. It loads the starting value as such that an overflow will occur at “event_per_sample” events. That overflow triggers an interrupt where information about the current running task is sampled.
Arguments
event_type
: determines type of event that sampling interval is based onevent_per_sample
: how many of those events should occur between each sampletask_id
: allows the user to choose to only sample from a specific task by inputting a number or sample from all tasks by inputting Nonesample_count
: specifies how many samples should be recorded.
Note
The function clears any previous values from sampling stored for this core, so values must be retrieved before starting a new sampling process. Currently can only sample “this” core - core that the function was called on.