scripts/runtime-dead — the reachable-but-never-runs instrument. No product
code, no pathway.
A run on this toolchain produced `never-ran.txt` naming all 3360 functions in
the crate and `TOTAL 0.00 %`, from a boot that reached the desktop, answered on
SSH, and passed the drag probe's did-the-window-move verdict. Nothing in the
output says it is broken; it is a deletion list for the whole device in the
format a reader is invited to act on.
Cause: `$OUT_DIR` has more writers than the boot. The crate's build scripts
write a raw each, and the boot script's own short-lived `qemu-system-x86_64`
probe invocations each dump the complete function table with every counter at
zero. The boot's own QEMU wrote a 0-byte raw, `-size +0c` dropped exactly that
one, `merge -sparse` then discarded the all-zero records the probes carried,
and the report was built from the six functions a build script had touched.
Two guards, both refusing to write rather than warning:
- Before the merge, the raw named by the QEMU pid the script itself SIGTERMed
must exist and be non-empty. This names the failure exactly.
- Before `never-ran.txt` is opened, not every function of ours may read zero
(and the export must contain some of ours at all). Backstop for a raw that is
present but all misses — reachable if the pid loop races a probe QEMU.
Deliberately not gating on `llvm-profdata show`'s `Instrumentation level:`: it
reports `Front-end` here even for the genuinely-instrumented 42141-function
dumps, so an `IR` check would refuse good runs. Noted in the README.
The README's claim that a bad toolchain gives "a silently 0-byte file, which is
how you will notice" was falsified by this run and is corrected: the 0-byte file
was written, and other non-empty files hid it.
Verified: `bash -n` clean; the guard replayed against the retained bad
`export.json` refuses and writes nothing, and against the same export with five
counts flipped non-zero it writes 3355 rows and exits 0. `note_packet_stamp_-
records` — called on every decoded packet — was in the bad list, which is what
made the list obviously wrong.
Not verified: no new instrumented boot was run, so the underlying reason QEMU's
atexit writer produces a 0-byte file on SIGTERM is not diagnosed. The guard
turns that into a refusal instead of a false report.
Co-Authored-By: Claude <noreply@anthropic.com>