#[repr(C)]pub struct CountAndTime {
pub count: u64,
pub time_enabled: u64,
pub time_running: u64,
}
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.
Trait Implementations§
Source§impl Clone for CountAndTime
impl Clone for CountAndTime
Source§fn clone(&self) -> CountAndTime
fn clone(&self) -> CountAndTime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more