pub struct Scheduling<T>where
T: Trace,{ /* private fields */ }Expand description
A Trace that passes on only the events a schedule is made of.
§What this is for
Turning tickless idle on changes a trace, so a raw byte-diff against the C
kernel’s cannot survive it – 15.2% of the conformance corpus is
TASK_INCREMENT_TICK. But it does not change the SCHEDULE: a task still
runs at the tick it would have run at, because the port winds the count
forward across the sleep.
This is the projection that says so. Wrap any sink in it and the events that reach the sink are exactly the ones a correct tickless port must not disturb – so two runs that differ only in whether they slept produce the same output, and a run that reordered, dropped or added a scheduling decision does not.
It is a claim about what is being proved, so it is worth being narrow:
is_suppressible names the three events dropped, and every other event
– every switch, every list move, every queue and event-group and timer
operation, with its tick stamp – goes through untouched.
use rusty_rtos_core::trace::{CountTrace, Event, Scheduling, Trace};
let mut projected = Scheduling::new(CountTrace::default());
projected.event(7, Event::TaskIncrementTick { tick: 7 });
projected.event(7, Event::StartingScheduler);
// The tick did not reach the sink; the scheduler start did.
assert_eq!(projected.into_inner().events, 1);Implementations§
Source§impl<T> Scheduling<T>where
T: Trace,
impl<T> Scheduling<T>where
T: Trace,
Sourcepub const fn new(inner: T) -> Scheduling<T>
pub const fn new(inner: T) -> Scheduling<T>
Project onto inner.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
The sink back out, to read whatever it collected.
Trait Implementations§
Source§impl<T> Clone for Scheduling<T>
impl<T> Clone for Scheduling<T>
Source§fn clone(&self) -> Scheduling<T>
fn clone(&self) -> Scheduling<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T> Copy for Scheduling<T>
Source§impl<T> Debug for Scheduling<T>
impl<T> Debug for Scheduling<T>
Source§impl<T> Default for Scheduling<T>
impl<T> Default for Scheduling<T>
Source§fn default() -> Scheduling<T>
fn default() -> Scheduling<T>
impl<T> Eq for Scheduling<T>
Source§impl<T> Hash for Scheduling<T>
impl<T> Hash for Scheduling<T>
Source§impl<T> PartialEq for Scheduling<T>
impl<T> PartialEq for Scheduling<T>
impl<T> StructuralPartialEq for Scheduling<T>
Source§impl<T> Trace for Scheduling<T>where
T: Trace,
impl<T> Trace for Scheduling<T>where
T: Trace,
Source§const WANTS_NAMES: bool = T::WANTS_NAMES
const WANTS_NAMES: bool = T::WANTS_NAMES
name an event carries. Read moreSource§fn note_exits(&mut self, exits: u64)
fn note_exits(&mut self, exits: u64)
Trace::event. Read more