Module verifier

Module verifier 

Source
Expand description

BPF verifier log parsing, cycle detection, and output formatting.

Provides:

Structs§

DiffRow
A single row in the A/B diff output.
ProgStats
Per-program verifier statistics collected from a VM run.
VerifierCellRecord
One cargo ktstr verifier cell’s outcome. The cell process writes it (via write_cell_record) into the directory named by crate::KTSTR_VERIFIER_RESULT_DIR_ENV; after nextest returns the dispatcher reads them back (via read_cell_records) and renders the per-(topology × scheduler) summary table. A cell is one (scheduler, kernel, topology): the verifier sweeps each declared scheduler across topologies, so topology IS a result axis — a scheduler can pass on one topology and fail on another.
VerifierStats
Parsed verifier stats from the kernel log line: processed N insns (limit M) max_states_per_insn X total_states Y peak_states Z mark_read W
VerifierVmResult
Result of collecting verifier output from a VM run.

Enums§

AttachOutcome
Whether the scheduler positively confirmed it turned on during a verifier VM run.

Functions§

build_b_map
Build the B-side lookup map from collected stats.
build_diff_rows
Build diff rows from A stats and B lookup map.
build_nextest_args
Build the cargo nextest run argument vector for the verifier sweep.
classify_run_outcome
Decide the cargo ktstr verifier run outcome from nextest’s exit success, whether any per-cell records were produced, and the optional --scheduler filter.
collapse_cycles
Collapse repeating cycles in a verifier log.
collect_verifier_output
Boot a VM and collect verifier statistics via host-side memory introspection. Per-program verified_insns comes from bpf_prog_aux->verified_insns read through the guest’s physical memory. On load failure, libbpf prints the verifier log to stderr; the returned scheduler_log field contains the scheduler’s captured output from the VM.
detect_cycle
Detect a single repeating cycle in a slice of lines.
extract_verifier_log
Extract the verifier instruction trace from a scheduler log blob.
format_verifier_diff
Format an A/B diff table comparing two sets of verifier stats.
format_verifier_output
Format verifier results as text: brief lines per program and collapsed logs.
normalize_verifier_line
Normalize a BPF verifier log line by stripping variable register-state annotations so that lines from different loop iterations compare equal.
parse_verifier_stats
Parse verifier stats from the log output.
read_cell_records
Read every *.json cell record under dir (non-recursive). A missing dir or an unparseable record is skipped (best-effort). Returns records in filesystem-iteration order; render_result_table sorts for a deterministic render.
render_instruction_count_tables
Render one verified_insns table per declared scheduler. Within each scheduler’s section: rows = kernel version, columns = BPF program, and each cell is that program’s verified_insns for the (scheduler, kernel) summarized ACROSS the topologies that ran it — a single number when topology-invariant, lo..hi when it varies (- when that program reported no stats on that kernel).
render_result_table
Render the per-cell records into a summary grid: one row per topology preset, one column per scheduler, aggregating across kernels. Each cell is: