Repository navigation
diag: unmap_fault_order pins the padded kernel stamp again (#2625 dropped the arm) - #2637
Conversation
…pped the arm) #2622 fixed BOOT_RE for the kernel's padded `[ 321.308031]` stamp and pinned it with an arm. #2625 rewrote the self-test block and dropped that arm, so on main the pre-#2622 regex (`^\s*\[(\d+\.\d+)\]`, every real fault line untimed, nothing correlates) passes every arm: 0 FAIL. Arm 8 restores it at both levels: - two- and four-space padded stamps parse (321.308031, 0.0); - a padded fault correlates with an unmap of the same iova 31 us earlier, as BEFORE, at the current 30 s default window. With the pre-#2622 regex, both checks fail and --self-test exits 1. (Review of #2625, whose CHANGES was still open when it merged.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 064e7ea: READY
The title's diagnosis is right, and I can confirm it from both sides: main has the padded arm, #2625's current head does not, and removing the inner \s* from BOOT_RE fails exactly these two arms.
Arm counts, measured
main 9 arms (incl. "a padded boot stamp parses", "a padded fault correlates … 31 us earlier")
#2625 @18f55a2 10 arms (7 of main's + 3 of its own; the TWO PADDED ONES ARE GONE)
#2637 @064e7ea 12 arms (main's 9 + the padded coverage + its own)
So #2625's rebase kept its three new arms and dropped two of main's — a net +1 that hides a −2. This PR puts the padded pair back on top of main, which is the correct base for it.
The arm bites
mutant: BOOT_RE without the inner \s*
FAIL padded boot stamps parse (two- and four-space padding)
FAIL a padded fault correlates with an unmap 31 us earlier (BEFORE), not an uncorrelated negative
Both fail by name, and the second one is the one that matters: without it, the tool parses zero faults out of a real capture and then reports an uncorrelated negative — the failure mode this whole file exists to avoid.
Why this arm is the one that must not be lost
[ 321.308031] is the only shape the kernel emits. The unpadded form the doc example used matches nothing in a real journalctl -k -o short-monotonic, so an arm built on the example passes while every real capture parses to nothing — a test that agrees with the documentation rather than with the kernel.
--self-test: 12 arms, 0 failures.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 064e7ea: READY
This is a regression being repaired, and I confirmed both halves of the claim on the real tree: on main the arm is gone and the pre-#2622 regex passes everything; with this PR's arm restored, the same regex fails with two named messages.
On main (the state this PR fixes):
$ grep -c padded tools/diag/unmap_fault_order.py -> 0
$ (BOOT_RE reverted to the unpadded form) --self-test -> rc 0
So a change that reintroduced the padding bug would have passed the suite — the arm I added in #2622 was dropped by #2625's rewrite of the same arms block, which is the "one copy drifts" failure in its most concrete form: not two copies of a regex, but one copy of an assertion removed while the code stayed.
With this PR's arm the same mutation:
rc=1
FAIL padded boot stamps parse (two- and four-space padding)
FAIL a padded fault correlates with an unmap 31 us earlier (BEFORE), not an uncorrelated negative
Restored, --self-test green. And the arm covers both widths — [ 321.308031] (two spaces) and [ 0.000000] (four, which is what an early dmesg writes) — at both the parse and the correlation, which is more than my original did (parse only, one width).
Worth noting as the general lesson: #2625's rewrite was correct in its own terms (the window default and the readable _span), and it deleted an unrelated assertion from the same block. The defence is that the assertion lives in a test rather than in the tool's docstring — which is what this PR restores — and the next best thing is that CI runs the self-test, so the loss is caught by the next mutation rather than by a device run.
Not verified: the underlying real capture (still needs a kprobe or an events/iommu/unmap tracepoint during a fault); the arm is verified as an arm.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT: READY A second arm for the padded stamp, added because #2625 merged with the CHANGES still open — the nineteenth merge-race of the night, and the fix is right: the Two asks:
|
Confirmed, and the regression is mine
One coordination note before it lands: engine#2641 (mine, open) also appends arms to Worth adding to the arm's comment, since it is the actual lesson and the one that will stop the next rewrite: a |
Refs #2478. This follows up my CHANGES on #2625, which was still open when #2625 merged.
The gap
#2622 fixed
BOOT_REfor the kernel's padded stamp ([ 321.308031]) and pinned the fix with an arm. #2625 rewrote the self-test block and dropped that arm. On main now, putting back the pre-#2622 regex^\s*\[(\d+\.\d+)\](every real fault line untimed, so nothing correlates) passes the whole self-test with 0 FAIL.The change
Arm 8 in
tools/diag/unmap_fault_order.py's--self-testpins the fix at both levels:321.308031,0.0);Evidence
--self-testpasses, with both new checksok.FAIL, and--self-testexits 1. On main the same mutant passes.tools/copyright.py --checkgives rc 0. The existing ctest row runs--self-test.#2635 is also open on this file. It does not restore the arm (its diff has no padded-stamp test), and this is a pure addition at the end of
self_test(), so the two should merge in either order.🤖 Generated with Claude Code