Commit 31b7ce3d authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Joel Fernandes
Browse files

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: default avatarPaul E. McKenney <paulmck@kernel.org>
Signed-off-by: default avatarJoel Fernandes <joelagnelf@nvidia.com>
parent 0af2f6be
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -39,8 +39,9 @@ do
	shift
done

err=
nerrs=0

# Test lockdep's handling of deadlocks.
for d in 0 1
do
	for t in 0 1 2
@@ -52,6 +53,12 @@ do
			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
			ret=$?
			mv "$T/kvm.sh.out" "$RCUTORTURE/res/$ds/$val"
			if ! grep -q '^CONFIG_PROVE_LOCKING=y' .config
			then
				echo "rcu_torture_init_srcu_lockdep:Error: CONFIG_PROVE_LOCKING disabled in rcutorture SRCU-P scenario"
				nerrs=$((nerrs+1))
				err=1
			fi
			if test "$d" -ne 0 && test "$ret" -eq 0
			then
				err=1
@@ -71,6 +78,8 @@ do
		done
	done
done

# Set up exit code.
if test "$nerrs" -ne 0
then
	exit 1