pub struct SchedulerTickCpuTime { /* private fields */ }Expand description
IRQ-safe tick-sampled user/system CPU time for one scheduler thread.
The object is retained by both the OS task and super::ThreadExtension.
Only the current CPU samples it from the periodic tick’s saved trap origin.
Implementations§
Source§impl SchedulerTickCpuTime
impl SchedulerTickCpuTime
Sourcepub fn with_realtime_gate(gate: Arc<SchedulerTickGate>) -> Self
pub fn with_realtime_gate(gate: Arc<SchedulerTickGate>) -> Self
Creates tick accounting with optional continuous real-time accounting.
The OS owns the shared gate. While enabled, actual FIFO/RR class ticks count at most once per common monotonic-clock period, including across migration. A real-time wake or PI deboost to Fair resets the count but preserves deduplication. Disabling the gate preserves previously accumulated ticks.
Sourcepub fn realtime_ticks(&self) -> Option<(u64, NonZeroU64)>
pub fn realtime_ticks(&self) -> Option<(u64, NonZeroU64)>
Returns continuous real-time ticks and their fixed period in nanoseconds.
Returns None until the first enabled real-time tick, or when this
stream has no real-time accounting. The period cannot change during
the stream’s lifetime. A wake or PI deboost may concurrently reset the count.
Sourcepub fn snapshot(&self) -> SchedulerTickCpuTimeSnapshot
pub fn snapshot(&self) -> SchedulerTickCpuTimeSnapshot
Returns the raw tick-accounted totals.