#[non_exhaustive]pub struct EventCounterSample {Show 14 fields
pub elapsed_ms: u64,
pub select_cpu_fallback: i64,
pub dispatch_local_dsq_offline: i64,
pub dispatch_keep_last: i64,
pub enq_skip_exiting: i64,
pub enq_skip_migration_disabled: i64,
pub reenq_immed: i64,
pub reenq_local_repeat: i64,
pub refill_slice_dfl: i64,
pub bypass_duration: i64,
pub bypass_dispatch: i64,
pub bypass_activate: i64,
pub insert_not_owned: i64,
pub sub_bypass_dispatch: i64,
}Expand description
One per-monitor-tick snapshot of the 13 SCX_EV_* event counters summed across every CPU at that tick.
The kernel stores per-CPU s64 counters in scx_sched_pcpu
(kernel/sched/ext.c); the monitor sampler reads them at every
tick and stores per-CPU event_counters on each
super::CpuSnapshot. The dump path sums across CPUs into the
fields here so a downstream consumer can render the run’s
counter timeline (sparkline, delta plot, …) without
re-iterating the per-CPU vec.
Field semantics match
super::ScxEventCounters one-to-one — see that struct’s
per-field doc for kernel-source provenance. total_* naming
here echoes super::ScxEventDeltas’s aggregate-across-window
fields but with per-tick (not per-window) granularity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.elapsed_ms: u64Milliseconds since VM start (mirrors
super::MonitorSample::elapsed_ms). Zero on the first
sample.
select_cpu_fallback: i64Sum of select_cpu_fallback across all CPUs at this tick.
dispatch_local_dsq_offline: i64Sum of dispatch_local_dsq_offline across all CPUs.
dispatch_keep_last: i64Sum of dispatch_keep_last across all CPUs.
enq_skip_exiting: i64Sum of enq_skip_exiting across all CPUs.
enq_skip_migration_disabled: i64Sum of enq_skip_migration_disabled across all CPUs.
reenq_immed: i64Sum of reenq_immed across all CPUs.
reenq_local_repeat: i64Sum of reenq_local_repeat across all CPUs.
refill_slice_dfl: i64Sum of refill_slice_dfl across all CPUs.
bypass_duration: i64Sum of bypass_duration across all CPUs (ns).
bypass_dispatch: i64Sum of bypass_dispatch across all CPUs.
bypass_activate: i64Sum of bypass_activate across all CPUs.
insert_not_owned: i64Sum of insert_not_owned across all CPUs.
sub_bypass_dispatch: i64Sum of sub_bypass_dispatch across all CPUs.
Implementations§
Source§impl EventCounterSample
impl EventCounterSample
Sourcepub fn from_monitor_sample(sample: &MonitorSample) -> Option<Self>
pub fn from_monitor_sample(sample: &MonitorSample) -> Option<Self>
Construct from a super::MonitorSample by summing every
CPU’s super::ScxEventCounters. CPUs whose
event_counters is None (event-stat offsets unresolved)
contribute 0 to every field.
Returns None when no CPU on the sample reported event
counters — propagating that to the timeline would emit a
row of all zeros that’s indistinguishable from a real
“every counter at zero” tick. Callers filter None out.
Trait Implementations§
Source§impl Clone for EventCounterSample
impl Clone for EventCounterSample
Source§fn clone(&self) -> EventCounterSample
fn clone(&self) -> EventCounterSample
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventCounterSample
impl Debug for EventCounterSample
Source§impl Default for EventCounterSample
impl Default for EventCounterSample
Source§fn default() -> EventCounterSample
fn default() -> EventCounterSample
Source§impl<'de> Deserialize<'de> for EventCounterSample
impl<'de> Deserialize<'de> for EventCounterSample
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for EventCounterSample
impl RefUnwindSafe for EventCounterSample
impl Send for EventCounterSample
impl Sync for EventCounterSample
impl Unpin for EventCounterSample
impl UnwindSafe for EventCounterSample
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more