Skip to main content

Module monitor

Module monitor 

Source

Structs§

AgeMonitorSpec
One monitored subscriber endpoint (W3b.5 age contracts). Separate table from MonitorSpec — sub contracts key different endpoints and need no publish counter.
HazardCell
One hazard’s observer state. Baked as a static beside the spec, the way PubMonitorCell is, so the observer adds a slice to the Executor value and nothing per hazard.
HazardMonitorSpec
One fault a hazard covers: a topic, or a redundant set of topics.
HazardSpec
One contracted hazard (contracts.hazards), lowered by the bake.
ModeDeadline
One SchedContext’s deadline in one mode.
ModeTables
One contract MODE’s variant of an executor’s two monitor tables: the base tables’ rows in the base’s order, sharing the base’s cells, with the mode’s numbers.
ModeTablesMismatch
A mode’s variant table is not the base table’s length, refused by super::Executor::set_mode_tables.
MonitorArming
When an executor’s contract monitors start judging.
MonitorSpec
One monitored publisher endpoint.
MonitorTableFull
A monitor table longer than the executor can watch.
PubMonitorCell
One contracted publisher’s counters. Baked as a static by codegen (or declared by the fixture); the publisher handle bumps count on every publish, the executor reads deltas on spin ticks.
ReactionEvent
What the reaction hook receives when a supervised route passes its deadline. repr(C): the C ABI hands the same struct through.
RouteWatch
An executor’s supervised routes, read from OUTSIDE it: from a port’s timer expiry, a reaction thread or an interrupt, while the spin thread is anywhere, including inside a dispatch.
RungSpec
One rung of a hazard’s ladder (contracts.hazards.<h>.rungs[], top first), lowered by the bake.
SubMonitorCell
One contracted subscriber’s take-age accumulator (W3b.5). The take path records epoch_now - header.stamp per message (fetch_max); the age check drains it (swap 0) per window.
Violation
A detected contract violation, in the play_launch rule-id vocabulary.

Enums§

HazardMonitorRef
One guard member: which monitor row’s verdict says this topic has faulted.

Constants§

MAX_AGE_MONITORS
Max AGE-monitored subscriptions per executor – the second table, on its own knob (NROS_EXECUTOR_MAX_AGE_MONITORS, derived from age_rows) so an image with rate contracts and no age contracts pays for one table only.
MAX_MONITORS
Max RATE/LATENCY-monitored endpoints per executor (inline table, no_std).
MAX_VIOLATIONS
Violation ring depth, per executor, and the slot count of the image-wide SWD record (ViolationRecord).
MECHANISM_EXECUTOR
MonitorSpec::mechanism: checked in the executor’s spin loop. Catches a slow route, not a callback that never returns.
MECHANISM_TIMER
MonitorSpec::mechanism: an independent timer outside the executor (the port’s), which also catches a stuck callback.
NO_MODE
RungSpec::mode for a rung that is not a contract mode (a reaction that is a single path has one rung, named after the path).
NO_SINK
HazardSpec::sink when the hazard’s reaction states no safe_state publisher this image monitors: the observer reports detection and recovery, and no reaction.
REACTION_NONE
MonitorSpec::reaction_id: no reaction named.
RULE_IDS
Every rule id the executor reports, in WIRE ORDER: a rule’s numeric code is its index here plus one, and 0 means “not a rule this table knows”.
RUNG_ROLE_FLOOR
The ladder’s last rung.
RUNG_ROLE_RUNG
RungSpec::role values, in rlm’s LevelRole order (RungRole before rlm v0.3.3).
RUNG_ROLE_WINDOW
A window: rung: lasts at least its window; the rung below takes over when the window passes.

Functions§

check_table_capacity
Whether a table of n_rows rate/latency rows and n_ages age rows fits this build’s executor. The rate table is judged first.
fqn_hash
32-bit FNV-1a of an endpoint ref – the identity a trace marker and the SWD record carry for Violation::fqn (a string neither can hold).
request_mode
Ask every executor to judge by mode id’s tables.
request_monitor_arming
The application says its start-up is over: arm the contract monitors of every executor in the image that waits for this (NROS_MONITOR_ARM_ON_CALL, or Executor::set_monitor_arming).
requested_mode
The mode last asked for with request_mode (0 when never asked).
route_next_due_us
Time from now to the earliest deadline of a pending supervised route, in microseconds (0 when one is already due), or None when no supervised route is waiting. This is the executor’s wake source for the rule, and what a port’s independent timer (MECHANISM_TIMER) arms on.
rule_code
The wire code of rule (RULE_IDS index + 1), or 0 for a rule the table does not know.
rule_name
The rule a wire code names, or None for 0 / an unknown code.

Type Aliases§

ReactionHookFn
The reaction hook: called on the spin thread, inside spin_once, once per missed route deadline. It must not block; it starts the fallback (or hands it to another thread) and returns. ctx is what was registered with the hook.