Skip to content

Commit 10cec0d

Browse files
committed
torture: Make --kcsan argument also create a summary
The KCSAN tool emits a great many warnings for current kernels, for example, a one-hour run of the full set of rcutorture scenarios results in no fewer than 3252 such warnings, many of which are duplicates or are otherwise closely related. This commit therefore introduces a kcsan-collapse.sh script that maps these warnings down to a set of function pairs (22 of them given the 3252 individual warnings), placing the resulting list in decreasing order of frequency of occurrence into a kcsan.sum file. If any KCSAN warnings were produced, the pathname of this file is emitted at the end of the summary of the rcutorture runs. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 7226c5c commit 10cec0d

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0+
3+
#
4+
# If this was a KCSAN run, collapse the reports in the various console.log
5+
# files onto pairs of functions.
6+
#
7+
# Usage: kcsan-collapse.sh resultsdir
8+
#
9+
# Copyright (C) 2020 Facebook, Inc.
10+
#
11+
# Authors: Paul E. McKenney <[email protected]>
12+
13+
if test -z "$TORTURE_KCONFIG_KCSAN_ARG"
14+
then
15+
exit 0
16+
fi
17+
cat $1/*/console.log |
18+
grep "BUG: KCSAN: " |
19+
sed -e 's/^\[[^]]*] //' |
20+
sort |
21+
uniq -c |
22+
sort -k1nr > $1/kcsan.sum

tools/testing/selftests/rcutorture/bin/kvm-recheck.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ do
7070
fi
7171
fi
7272
done
73+
if test -f "$rd/kcsan.sum"
74+
then
75+
if test -s "$rd/kcsan.sum"
76+
then
77+
echo KCSAN summary in $rd/kcsan.sum
78+
else
79+
echo Clean KCSAN run in $rd
80+
fi
81+
fi
7382
done
7483
EDITOR=echo kvm-find-errors.sh "${@: -1}" > $T 2>&1
7584
ret=$?

tools/testing/selftests/rcutorture/bin/kvm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ echo
472472
echo
473473
echo " --- `date` Test summary:"
474474
echo Results directory: $resdir/$ds
475+
kcsan-collapse.sh $resdir/$ds
475476
kvm-recheck.sh $resdir/$ds
476477
___EOF___
477478

0 commit comments

Comments
 (0)