Skip to content

Commit 59359e4

Browse files
committed
rcutorture: Handle non-statistic bang-string error messages
The current console parsing assumes that console lines containing "!!!" are statistics lines from which it can parse the number of rcutorture too-short grace-period failures. This prints confusing output for other problems, including memory exhaustion. This commit therefore differentiates between these cases and prints an appropriate error string. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 61251d6 commit 59359e4

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tools/testing/selftests/rcutorture/bin/parse-console.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,23 @@ then
4444
tail -1 |
4545
awk '
4646
{
47-
for (i=NF-8;i<=NF;i++)
47+
normalexit = 1;
48+
for (i=NF-8;i<=NF;i++) {
49+
if (i <= 0 || i !~ /^[0-9]*$/) {
50+
bangstring = $0;
51+
gsub(/^\[[^]]*] /, "", bangstring);
52+
print bangstring;
53+
normalexit = 0;
54+
exit 0;
55+
}
4856
sum+=$i;
57+
}
4958
}
50-
END { print sum }'`
51-
print_bug $title FAILURE, $nerrs instances
59+
END {
60+
if (normalexit)
61+
print sum " instances"
62+
}'`
63+
print_bug $title FAILURE, $nerrs
5264
exit
5365
fi
5466

0 commit comments

Comments
 (0)