[PATCH 15/17] rcutorture: Test NMI console-log boundaries
From: Kunwu Chan
Date: Tue Dec 01 2026 - 11:21:59 EST
Verify that the checker requires one complete NMI coverage summary
before the matching successful test result. Reject logs that report
dropped printk records or duplicate test results. Accept a split
periodic histogram when the final summary and result are intact.
Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>
---
.../rcutorture/bin/kvm-recheck-nmi-test.sh | 51 +++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-nmi-test.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-nmi-test.sh
index 2a37d9a25747..c674ed2c4eaf 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-nmi-test.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-nmi-test.sh
@@ -114,6 +114,57 @@ srcud-torture: NMI coverage: reads=$exact_count samples=$next_count too-old=0 ca
srcud-torture:--- End of test: SUCCESS
EOF
+check duplicate-test-result 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture:--- End of test: SUCCESS
+srcud-torture:--- End of test: SUCCESS
+EOF
+check incomplete-run 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+EOF
+check failed-run 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture:--- End of test: FAILURE
+EOF
+check missing-final-summary 1 both <<'EOF'
+srcud-torture: rtc: 1234 ver: 1 nmi-calls: 2 nmi-cbs: 2 nmi-reads: 3
+srcud-torture: NMI Reader Pipe: 2 1 0 0 0 0 0 0 0 0 0
+srcud-torture:--- End of test: SUCCESS
+EOF
+check duplicate-final-summary 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture:--- End of test: SUCCESS
+EOF
+check valid-summary-after-malformed-summary 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=broken samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+srcud-torture:--- End of test: SUCCESS
+EOF
+check summary-after-success 1 both <<'EOF'
+srcud-torture:--- End of test: SUCCESS
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+EOF
+check different-flavor-success 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+rcu-torture:--- End of test: SUCCESS
+EOF
+check printk-records-dropped 1 both <<'EOF'
+srcud-torture: NMI coverage: reads=3 samples=3 too-old=0 calls=2 callbacks=2
+** 3 printk messages dropped **
+srcud-torture:--- End of test: SUCCESS
+EOF
+check split-periodic-pipe 0 both < <(printf '%s %s\r\n' \
+ '[ 5.000000][ T1]' \
+ 'srcud-torture: rtc: 1234 ver: 1 nmi-calls: 2 nmi-cbs: 1 nmi-reads: 3' \
+ '[ 5.000001][ T1]' 'srcud-torture: NMI Reader Pipe: 2 1 0 0 0' \
+ '[ 5.000002][ C1]' 'other kernel message' \
+ '[ 5.000003][ T1]' '0 0 0 0 0 0' \
+ '[ 6.000000][ T1]' 'rcu_torture_cleanup: Invoking srcu_barrier().' \
+ '[ 6.000001][ T1]' \
+ 'srcud-torture: NMI coverage: reads=6 samples=6 too-old=0 calls=2 callbacks=2' \
+ '[ 6.000002][ T1]' 'srcud-torture:--- End of test: SUCCESS: nreaders=4')
+
if test "$nfailed" -ne 0
then
exit 1
--
2.43.0