diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2020-02-14 14:43:44 -0800 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-04-27 11:05:13 -0700 |
commit | b3578186b28da4ed5d0852ec69c13a7bce15b5fd (patch) | |
tree | 89e9c7b0a086f2cd4103f8042fee375d072e04f1 | |
parent | 3b2a47398552938d2ae0091f35eb3658a52a0769 (diff) | |
download | lwn-b3578186b28da4ed5d0852ec69c13a7bce15b5fd.tar.gz lwn-b3578186b28da4ed5d0852ec69c13a7bce15b5fd.zip |
rcutorture: Make kvm-recheck-rcu.sh handle truncated lines
System hangs or killed rcutorture guest OSes can result in truncated
"Reader Pipe:" lines, which can in turn result in false-positive
reader-batch near-miss warnings. This commit therefore adjusts the
reader-batch checks to account for possible line truncation.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh index 9d9a41625dd9..1706cd4466b4 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh @@ -41,7 +41,21 @@ else title="$title ($ngpsps/s)" fi echo $title $stopstate $fwdprog - nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` + nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | \ + awk -v sum=0 ' + { + for (i = 0; i <= NF; i++) { + sum += $i; + if ($i ~ /Batch:/) { + sum = 0; + i = i + 2; + } + } + } + + END { + print sum + }'` if test -z "$nclosecalls" then exit 0 |