aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-30 13:48:06 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-04-21 16:47:04 -0400
commitacc1adf5572205c5b3fc9e6983ca8dfb06c94520 (patch)
treebb68cf38bc1c922fc87defd384a6e655af7cc897
parent6e524a603f0b72281019e4ec29b1022388f9f231 (diff)
rcutorture: Don't rebuild identical kernel
Currently, if the user specifies multiple runs of a given test configuration, the scripting does multiple kernel builds. This wastes both time and disk space, so this commit makes the scripting use the first build for all runs of a given test configuration. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index 73a265668421..4109f306d855 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -91,25 +91,33 @@ fi
91# CONFIG_PCMCIA=n 91# CONFIG_PCMCIA=n
92# CONFIG_CARDBUS=n 92# CONFIG_CARDBUS=n
93# CONFIG_YENTA=n 93# CONFIG_YENTA=n
94if kvm-build.sh $config_template $builddir $T 94base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'`
95if test "$base_resdir" != "$resdir" -a -f $base_resdir/bzImage -a -f $base_resdir/vmlinux
95then 96then
97 # Rerunning previous test, so use that test's kernel.
98 QEMU="`identify_qemu $base_resdir/vmlinux`"
99 KERNEL=$base_resdir/bzImage
100 ln -s $base_resdir/Make*.out $resdir # for kvm-recheck.sh
101 ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
102elif kvm-build.sh $config_template $builddir $T
103then
104 # Had to build a kernel for this test.
96 QEMU="`identify_qemu $builddir/vmlinux`" 105 QEMU="`identify_qemu $builddir/vmlinux`"
97 BOOT_IMAGE="`identify_boot_image $QEMU`" 106 BOOT_IMAGE="`identify_boot_image $QEMU`"
98 cp $builddir/Make*.out $resdir 107 cp $builddir/Make*.out $resdir
108 cp $builddir/vmlinux $resdir
99 cp $builddir/.config $resdir 109 cp $builddir/.config $resdir
100 if test -n "$BOOT_IMAGE" 110 if test -n "$BOOT_IMAGE"
101 then 111 then
102 cp $builddir/$BOOT_IMAGE $resdir 112 cp $builddir/$BOOT_IMAGE $resdir
113 KERNEL=$resdir/bzImage
103 else 114 else
104 echo No identifiable boot image, not running KVM, see $resdir. 115 echo No identifiable boot image, not running KVM, see $resdir.
105 echo Do the torture scripts know about your architecture? 116 echo Do the torture scripts know about your architecture?
106 fi 117 fi
107 parse-build.sh $resdir/Make.out $title 118 parse-build.sh $resdir/Make.out $title
108 if test -f $builddir.wait
109 then
110 mv $builddir.wait $builddir.ready
111 fi
112else 119else
120 # Build failed.
113 cp $builddir/Make*.out $resdir 121 cp $builddir/Make*.out $resdir
114 cp $builddir/.config $resdir || : 122 cp $builddir/.config $resdir || :
115 echo Build failed, not running KVM, see $resdir. 123 echo Build failed, not running KVM, see $resdir.
@@ -119,6 +127,10 @@ else
119 fi 127 fi
120 exit 1 128 exit 1
121fi 129fi
130if test -f $builddir.wait
131then
132 mv $builddir.wait $builddir.ready
133fi
122while test -f $builddir.ready 134while test -f $builddir.ready
123do 135do
124 sleep 1 136 sleep 1
@@ -166,8 +178,8 @@ then
166 exit 0 178 exit 0
167fi 179fi
168echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log 180echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
169echo $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd 181echo $QEMU $qemu_args -m 512 -kernel $KERNEL -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
170( $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append "$qemu_append $boot_args"& echo $! > $resdir/qemu_pid; wait `cat $resdir/qemu_pid`; echo $? > $resdir/qemu-retval ) & 182( $QEMU $qemu_args -m 512 -kernel $KERNEL -append "$qemu_append $boot_args"& echo $! > $resdir/qemu_pid; wait `cat $resdir/qemu_pid`; echo $? > $resdir/qemu-retval ) &
171commandcompleted=0 183commandcompleted=0
172sleep 10 # Give qemu's pid a chance to reach the file 184sleep 10 # Give qemu's pid a chance to reach the file
173if test -s "$resdir/qemu_pid" 185if test -s "$resdir/qemu_pid"