Expand description
BPF verifier log parsing, cycle detection, and output formatting.
Provides:
VerifierStats/ProgStats/DiffRow— data typescollect_verifier_output— boot VM, collect stats via host introspectionformat_verifier_output/format_verifier_diff— text formattingextract_verifier_log— extract verifier trace from libbpf log blobparse_verifier_stats— extract insn/state counts from verifier lognormalize_verifier_line— strip variable register state annotationsdetect_cycle/collapse_cycles— loop iteration compressionbuild_b_map/build_diff_rows— A/B comparison helpersSCHED_OUTPUT_START/SCHED_OUTPUT_END— delimiters the guest’s rust_init emits over the bulk port (asMSG_TYPE_SCHED_LOGframes) around the scheduler log region;parse_sched_outputextracts the enclosed block
Structs§
- DiffRow
- A single row in the A/B diff output.
- Prog
Stats - Per-program verifier statistics collected from a VM run.
- Verifier
Cell Record - One
cargo ktstr verifiercell’s outcome. The cell process writes it (viawrite_cell_record) into the directory named bycrate::KTSTR_VERIFIER_RESULT_DIR_ENV; after nextest returns the dispatcher reads them back (viaread_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. - Verifier
Stats - 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 - Verifier
VmResult - Result of collecting verifier output from a VM run.
Enums§
- Attach
Outcome - 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 runargument vector for the verifier sweep. - classify_
run_ outcome - Decide the
cargo ktstr verifierrun outcome from nextest’s exit success, whether any per-cell records were produced, and the optional--schedulerfilter. - 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_insnscomes frombpf_prog_aux->verified_insnsread through the guest’s physical memory. On load failure, libbpf prints the verifier log to stderr; the returnedscheduler_logfield 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
*.jsoncell record underdir(non-recursive). A missing dir or an unparseable record is skipped (best-effort). Returns records in filesystem-iteration order;render_result_tablesorts for a deterministic render. - render_
instruction_ count_ tables - Render one
verified_insnstable per declared scheduler. Within each scheduler’s section: rows = kernel version, columns = BPF program, and each cell is that program’sverified_insnsfor the (scheduler, kernel) summarized ACROSS the topologies that ran it — a single number when topology-invariant,lo..hiwhen 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: