pub struct RqClockSample { /* private fields */ }Expand description
One Linux-style runqueue-clock observation for a target CPU.
clock is the corrected sched_clock_cpu() value. hardirq_time_ns is
present only when the runtime enables Linux-style IRQ time accounting and
can publish the target CPU’s cumulative interrupt time coherently with that
clock. The runqueue owner must treat absence like Linux built without
CONFIG_IRQ_TIME_ACCOUNTING: task time advances by the full clock delta and
IRQ PELT remains disabled.
Implementations§
Source§impl RqClockSample
impl RqClockSample
Sourcepub const fn new(clock: SchedulerTimestamp, hardirq_time_ns: u64) -> Self
pub const fn new(clock: SchedulerTimestamp, hardirq_time_ns: u64) -> Self
Creates one coherent runqueue-clock observation.
Sourcepub const fn without_irq_time_accounting(clock: SchedulerTimestamp) -> Self
pub const fn without_irq_time_accounting(clock: SchedulerTimestamp) -> Self
Creates a sample from a runtime without IRQ time accounting authority.
Sourcepub const fn with_capacity_scales(
clock: SchedulerTimestamp,
hardirq_time_ns: u64,
frequency_capacity: u32,
cpu_capacity: u32,
) -> Option<Self>
pub const fn with_capacity_scales( clock: SchedulerTimestamp, hardirq_time_ns: u64, frequency_capacity: u32, cpu_capacity: u32, ) -> Option<Self>
Adds Linux scheduler-capacity scaling for the sampled CPU.
Both scales use SCHED_CAPACITY_SCALE == 1024. The current ArceOS
runtime uses the full-capacity default on fixed-frequency homogeneous
systems; a platform with frequency invariance can publish narrower
values through this constructor.
Sourcepub const fn clock(self) -> SchedulerTimestamp
pub const fn clock(self) -> SchedulerTimestamp
Returns the corrected scheduler-clock value.
Sourcepub const fn hardirq_time_ns(self) -> Option<u64>
pub const fn hardirq_time_ns(self) -> Option<u64>
Returns cumulative hard-interrupt time for the target CPU.
Sourcepub const fn frequency_capacity(self) -> u32
pub const fn frequency_capacity(self) -> u32
Returns Linux arch_scale_freq_capacity() units.
Sourcepub const fn cpu_capacity(self) -> u32
pub const fn cpu_capacity(self) -> u32
Returns Linux arch_scale_cpu_capacity() units.
Trait Implementations§
Source§impl Clone for RqClockSample
impl Clone for RqClockSample
Source§fn clone(&self) -> RqClockSample
fn clone(&self) -> RqClockSample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more