torture: Add --trust-make to suppress "make clean"
authorPaul E. McKenney <paulmck@linux.ibm.com>
Sun, 12 May 2019 03:18:00 +0000 (20:18 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Tue, 28 May 2019 16:06:09 +0000 (09:06 -0700)
The current rcutorture scripts unconditionally do "make clean", which is
a good way of getting the needed testing done despite any imperfections in
Makefile dependency tracking.  However, this can be a bit irritating when
repeatedly running a single scenario after small changes, for example,
when debugging a problem that affects only a single scenario.  This commit
therefore adds a --trust-make argument that suppresses the "make clean".

Even when using ccache, this speeds up kernel builds by up to almost an
order of magnitude on my laptop.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
tools/testing/selftests/rcutorture/bin/configinit.sh
tools/testing/selftests/rcutorture/bin/kvm.sh
tools/testing/selftests/rcutorture/bin/parse-build.sh

index bbeae6f67c3607bab7afe1635c6e4c308822aeb7..93e80a42249a75ffe3a60dc490a74100c5e0bff8 100755 (executable)
@@ -28,7 +28,10 @@ sed -e 's/^\(CONFIG[0-9A-Z_]*\)=.*$/grep -v "^# \1" |/' < $c > $T/u.sh
 sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh
 grep '^grep' < $T/u.sh > $T/upd.sh
 echo "cat - $c" >> $T/upd.sh
-make clean > $resdir/Make.clean 2>&1
+if test -z "$TORTURE_TRUST_MAKE"
+then
+       make clean > $resdir/Make.clean 2>&1
+fi
 make $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
 mv .config .config.sav
 sh $T/upd.sh < .config.sav > .config
index ea6289a335f2223feb793c382b6d930e02db59a6..72518580df2367f024e5a257bc1340c655b2ecfd 100755 (executable)
@@ -33,6 +33,7 @@ TORTURE_KMAKE_ARG=""
 TORTURE_QEMU_MEM=512
 TORTURE_SHUTDOWN_GRACE=180
 TORTURE_SUITE=rcu
+TORTURE_TRUST_MAKE=""
 resdir=""
 configs=""
 cpus=0
@@ -63,6 +64,7 @@ usage () {
        echo "       --qemu-cmd qemu-system-..."
        echo "       --results absolute-pathname"
        echo "       --torture rcu"
+       echo "       --trust-make"
        exit 1
 }
 
@@ -175,6 +177,9 @@ do
                        jitter=0
                fi
                ;;
+       --trust-make)
+               TORTURE_TRUST_MAKE="y"
+               ;;
        *)
                echo Unknown argument $1
                usage
@@ -300,6 +305,7 @@ TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC"; export TORTURE_QEMU_MAC
 TORTURE_QEMU_MEM="$TORTURE_QEMU_MEM"; export TORTURE_QEMU_MEM
 TORTURE_SHUTDOWN_GRACE="$TORTURE_SHUTDOWN_GRACE"; export TORTURE_SHUTDOWN_GRACE
 TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
+TORTURE_TRUST_MAKE="$TORTURE_TRUST_MAKE"; export TORTURE_TRUST_MAKE
 if ! test -e $resdir
 then
        mkdir -p "$resdir" || :
index 0701b3bf6adea122e2792a23b107d4f0f44e5ae8..09155c15ea651549d8958a0fa52db9ff67f6f758 100755 (executable)
@@ -21,7 +21,7 @@ mkdir $T
 
 . functions.sh
 
-if grep -q CC < $F
+if grep -q CC < $F || test -n "$TORTURE_TRUST_MAKE"
 then
        :
 else