Skip to main content

SchedulerTickCpuTime

Struct SchedulerTickCpuTime 

Source
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

Source

pub const fn new() -> Self

Creates an empty accounting stream.

Source

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.

Source

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.

Source

pub fn snapshot(&self) -> SchedulerTickCpuTimeSnapshot

Returns the raw tick-accounted totals.

Trait Implementations§

Source§

impl Debug for SchedulerTickCpuTime

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SchedulerTickCpuTime

Source§

fn default() -> Self

Returns the “default value” for a type. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.