Skip to content

Commit 31b7ce3

Browse files
paulmckrcuJoel Fernandes
authored andcommitted
rcutorture: Make srcu_lockdep.sh check kernel Kconfig
The srcu_lockdep.sh currently blindly trusts the rcutorture SRCU-P scenario to build its kernel with lockdep enabled. Of course, this dependency might not be obvious to someone rebalancing SRCU scenarios. This commit therefore adds code to srcu_lockdep.sh that verifies that the .config file has lockdep enabled. Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Joel Fernandes <[email protected]>
1 parent 0af2f6b commit 31b7ce3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ do
3939
shift
4040
done
4141

42-
err=
4342
nerrs=0
43+
44+
# Test lockdep's handling of deadlocks.
4445
for d in 0 1
4546
do
4647
for t in 0 1 2
@@ -52,6 +53,12 @@ do
5253
tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 5s --configs "SRCU-P" --kconfig "CONFIG_FORCE_NEED_SRCU_NMI_SAFE=y" --bootargs "rcutorture.test_srcu_lockdep=$val rcutorture.reader_flavor=0x2" --trust-make --datestamp "$ds/$val" > "$T/kvm.sh.out" 2>&1
5354
ret=$?
5455
mv "$T/kvm.sh.out" "$RCUTORTURE/res/$ds/$val"
56+
if ! grep -q '^CONFIG_PROVE_LOCKING=y' .config
57+
then
58+
echo "rcu_torture_init_srcu_lockdep:Error: CONFIG_PROVE_LOCKING disabled in rcutorture SRCU-P scenario"
59+
nerrs=$((nerrs+1))
60+
err=1
61+
fi
5562
if test "$d" -ne 0 && test "$ret" -eq 0
5663
then
5764
err=1
@@ -71,6 +78,8 @@ do
7178
done
7279
done
7380
done
81+
82+
# Set up exit code.
7483
if test "$nerrs" -ne 0
7584
then
7685
exit 1

0 commit comments

Comments
 (0)