Skip to main content

Module preemptions

Module preemptions 

Source
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§

PreemptionReader
A reader for a stream of preemption events.
PreemptionRecord
A record of all the preemptions and other scheduling events that occur during execution.
PreemptionWriter
A writer for a stream of preemption events.
RecordAdmissionRefusal
A schedule admission policy failure, not malformed JSON or a replay desync.
RecordFormatRefusal
A record whose format, or jumps of global time, this Hermit refuses to replay (PreemptionRecord::validate_format): a policy refusal, not a malformed file.
ReservedInputMetadata
An optional JSON member, distinguishing absence from a present null.
ThreadHistory
The record of priorities and preemptions for a particular thread.
ThreadHistoryIterator
An iterator over the preemption history of a thread. Does not include the final timeslice, which does not have an ending time.
TimeSkip
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§

TimeSkipReason
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. None for an unannotated run or a qualified one.
cap_preemption_charge_mismatch
The refusal of a replay whose --cap-preemption-charge differs from the one a record stores, naming the record by source (an option and a path), or None when they agree.
draw_chaos_timeslice
The --max-timeslice a chaos run with --chaos-timeslice-draw=run draws: log-uniform over range, 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-charge differs from the rule a record states (recorded_once, as read_recorded_expired_wait_runs_charged_once reads it), naming the record by source (an option and a path), or None when 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, or None when they number it alike (GuestIds::numbers_like).
pipe_wake_latency_mismatch
The refusal of a replay whose --pipe-wake-latency differs from the one a record stores, naming the record by source (an option and a path), or None when 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), as read_recorded_epoch reads 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_epoch reads 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), as read_recorded_epoch reads 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_epoch reads the epoch. Ok(false) for a record that does not say: one written before the field existed, or by a run under the each rule (by default race search), both of which charged every wait.
read_recorded_guest_ids
How the run that wrote the record at path numbered its guest, as the record stores it: GuestIds::Namespace for 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-latency stored in a preemption record file, as read_recorded_epoch reads 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-seed stored in a preemption record file, as read_recorded_epoch reads 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_epoch reads 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), or None when 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.