Expand description
A datatype to abstract a record of thread preemptions, as generated during chaos mode execution.
Modules§
- boundary_
recording - File-format boundary between legacy editors and explicit slice records. The scheduler consumes the complete stream; legacy editors must refuse it. History-only replay and read-only inspection never rewrite that stream.
- callback_
history - Software callback expirations in an otherwise unchanged legacy event replay. These coordinates do not program the PMU or select a runnable owner.
Structs§
- Preemption
Reader - A reader for a stream of preemption events.
- Preemption
Record - A record of all the preemptions and other scheduling events that occur during execution.
- Preemption
Writer - A writer for a stream of preemption events.
- Record
Admission Refusal - A schedule admission policy failure, not malformed JSON or a replay desync.
- Record
Format Refusal - A record whose format, or jumps of global time, this Hermit refuses to
replay (
PreemptionRecord::validate_format): a policy refusal, not a malformed file. - Reserved
Input Metadata - An optional JSON member, distinguishing absence from a present null.
- Thread
History - The record of priorities and preemptions for a particular thread.
- Thread
History Iterator - An iterator over the preemption history of a thread. Does not include the final timeslice, which does not have an ending time.
- Time
Skip - One jump of global time. A replay of the record makes it where the
recording did, as replay drives context switches, and checks it: its target
must still lie ahead, and no finite deadline the replay knows, then or
later, may come before it, or the replay reports a desync
(
Scheduler::make_recorded_time_skip).
Enums§
- Time
Skip Reason - Why the scheduler moved global time ahead to a deadline.
Constants§
- PREEMPTION_
RECORD_ FORMAT - The newest preemption-record format this Hermit writes and reads
(
PreemptionRecord::format_version), one counter for every format change: a record of format N has every property of the formats before it. - SWITCH_
IN_ CHARGE_ FORMAT - The format from which a schedule replay charges a scheduler turn for every
replayed switch to a thread that then runs guest code
(
Scheduler::bump_global_time), as the run that wrote the record charged the yield turn the switch stands for. A run charges every such stretch when it follows no record, or follows one of this format. A replay of an older record charges as before: its writer cannot say whether its own run followed a schedule, and so left those stretches uncharged. - TIME_
SKIPS_ FORMAT - The format from which a record lists all its jumps of global time.
Functions§
- annotated_
replay_ mode_ refusal - Detcore’s own refusal of a run prepared to replay a callback-annotated
priority history (
Config::annotated_priority_replay) on an effective configuration that cannot honor its row ends (Config::annotated_priority_replay_unqualified), checked before the scheduler or any history exists. Hosts refuse earlier, by name; this backstop holds for every configuration that reaches Detcore, whoever prepared it.Nonefor an unannotated run or a qualified one. - cap_
preemption_ charge_ mismatch - The refusal of a replay whose
--cap-preemption-chargediffers from the one a record stores, naming the record bysource(an option and a path), orNonewhen they agree. - draw_
chaos_ timeslice - The
--max-timeslicea chaos run with--chaos-timeslice-draw=rundraws: log-uniform overrange, both bounds included, as a pure function of the scheduler seed. A stream of its own (CHAOS_TIMESLICE_SALT) keeps it independent of the seed’s other draws, so adding the option changes no other random choice of the run. - expired_
wait_ charge_ mismatch - The refusal of a replay whose explicit
--expired-wait-chargediffers from the rule a record states (recorded_once, asread_recorded_expired_wait_runs_charged_oncereads it), naming the record bysource(an option and a path), orNonewhen they agree or the replay leaves the option unset, and so takes the record’s rule. For a search (hermit analyze,hermit bisect), which runs every trial under one rule, the remedy names the recordings instead. - guest_
ids_ mismatch - The refusal of a replay whose guest would be numbered otherwise than the
run that a record (named by
source, an option and a path) came from, orNonewhen they number it alike (GuestIds::numbers_like). - pipe_
wake_ latency_ mismatch - The refusal of a replay whose
--pipe-wake-latencydiffers from the one a record stores, naming the record bysource(an option and a path), orNonewhen they agree. Absent and off are the same;Some(0)is not off. - read_
recorded_ callback_ checkpoints - Read only whether a preemption record file carries callback checkpoints
(
Config::annotated_priority_replay), asread_recorded_epochreads the epoch. A record without the field, older or made without chaos recording, carries none. Detcore validates the whole record, checkpoints included, when it loads it for the run. - read_
recorded_ cap_ preemption_ charge - Read only whether the run that wrote a preemption record file capped
preemption charges, as
read_recorded_epochreads the epoch. A record without the field was made with the option off. - read_
recorded_ chaos_ timeslice - Read only the timeslice a preemption record file states its run drew under
--chaos-timeslice-draw=run(PreemptionRecord::chaos_timeslice), asread_recorded_epochreads the epoch.Ok(None)for a record without one. - read_
recorded_ epoch - Read only the virtual-time epoch stored in a preemption record file.
- read_
recorded_ expired_ wait_ runs_ charged_ once - Read only whether the run that wrote a preemption record file charged a
run of expired timed waits one turn, as
read_recorded_epochreads the epoch.Ok(false)for a record that does not say: one written before the field existed, or by a run under theeachrule (by default race search), both of which charged every wait. - read_
recorded_ guest_ ids - How the run that wrote the record at
pathnumbered its guest, as the record stores it:GuestIds::Namespacefor a record that does not say, which only a run its PID namespace numbered, or one before the field existed, writes. - read_
recorded_ pipe_ wake_ latency - Read only the
--pipe-wake-latencystored in a preemption record file, asread_recorded_epochreads the epoch.Ok(None)means the record was made with the option off, or before the field existed. - read_
recorded_ replay_ departure - Read only whether a preemption record was written by a replay that left a
change point out of it (
PreemptionRecord::replay_departed_at). - read_
recorded_ reserved_ input - Preserve missing/unknown metadata when inspecting either JSON envelope.
- read_
recorded_ rng_ seed - Read only the
--rng-seedstored in a preemption record file, asread_recorded_epochreads the epoch.Ok(None)means the record predates the field. - read_
recorded_ signal_ state_ copy - Read only whether the signal-state copy was on in the run that wrote a
preemption record file, as
read_recorded_epochreads the epoch.Ok(None)for a record written before the field existed. - read_
trace - Read a full trace from disk. Panic if it doesn’t load.
- signal_
state_ copy_ mismatch - The refusal of a replay whose signal-state copy setting differs from the
one a record stores, naming the record by
source(an option and a path), orNonewhen they agree or the record does not say. - strip_
times_ from_ events_ file - Take a file containing a PreemptionRecord and strip the times from all the events. Optionally take a destination path, otherwise create a destination file in the same directory with our own naming convention.
- validate_
config_ replay_ inputs - Early launch preflight. Each authoritative loader repeats the check on the same immutable decoded bytes it installs; this pathname check is not that final authority. Both Config inputs are checked independently.