Struct perf_event::CountAndTime
source · Expand description
The value of a counter, along with timesharing data.
Some counters are implemented in hardware, and the processor can run only a fixed number of them at a time. If more counters are requested than the hardware can support, the kernel timeshares them on the hardware.
This struct holds the value of a counter, together with the time it was enabled, and the proportion of that for which it was actually running.
Fields
count: u64
The counter value.
The meaning of this field depends on how the counter was configured when it was built; see [‘Builder’].
time_enabled: u64
How long this counter was enabled by the program, in nanoseconds.
time_running: u64
How long the kernel actually ran this counter, in nanoseconds.
If time_enabled == time_running
, then the counter ran for the entire
period it was enabled, without interruption. Otherwise, the counter
shared the underlying hardware with others, and you should prorate its
value accordingly.