diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-03-30 13:48:06 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-04-21 16:47:04 -0400 |
commit | acc1adf5572205c5b3fc9e6983ca8dfb06c94520 (patch) | |
tree | bb68cf38bc1c922fc87defd384a6e655af7cc897 | |
parent | 6e524a603f0b72281019e4ec29b1022388f9f231 (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-x | tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 26 |
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 |
94 | if kvm-build.sh $config_template $builddir $T | 94 | base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'` |
95 | if test "$base_resdir" != "$resdir" -a -f $base_resdir/bzImage -a -f $base_resdir/vmlinux | ||
95 | then | 96 | then |
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 | ||
102 | elif kvm-build.sh $config_template $builddir $T | ||
103 | then | ||
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 | ||
112 | else | 119 | else |
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 |
121 | fi | 129 | fi |
130 | if test -f $builddir.wait | ||
131 | then | ||
132 | mv $builddir.wait $builddir.ready | ||
133 | fi | ||
122 | while test -f $builddir.ready | 134 | while test -f $builddir.ready |
123 | do | 135 | do |
124 | sleep 1 | 136 | sleep 1 |
@@ -166,8 +178,8 @@ then | |||
166 | exit 0 | 178 | exit 0 |
167 | fi | 179 | fi |
168 | echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log | 180 | echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log |
169 | echo $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd | 181 | echo $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 ) & |
171 | commandcompleted=0 | 183 | commandcompleted=0 |
172 | sleep 10 # Give qemu's pid a chance to reach the file | 184 | sleep 10 # Give qemu's pid a chance to reach the file |
173 | if test -s "$resdir/qemu_pid" | 185 | if test -s "$resdir/qemu_pid" |