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>
This commit is contained in:
parent
6e524a603f
commit
acc1adf557
@ -91,25 +91,33 @@ fi
|
|||||||
# CONFIG_PCMCIA=n
|
# CONFIG_PCMCIA=n
|
||||||
# CONFIG_CARDBUS=n
|
# CONFIG_CARDBUS=n
|
||||||
# CONFIG_YENTA=n
|
# CONFIG_YENTA=n
|
||||||
if kvm-build.sh $config_template $builddir $T
|
base_resdir=`echo $resdir | sed -e 's/\.[0-9]\+$//'`
|
||||||
|
if test "$base_resdir" != "$resdir" -a -f $base_resdir/bzImage -a -f $base_resdir/vmlinux
|
||||||
then
|
then
|
||||||
|
# Rerunning previous test, so use that test's kernel.
|
||||||
|
QEMU="`identify_qemu $base_resdir/vmlinux`"
|
||||||
|
KERNEL=$base_resdir/bzImage
|
||||||
|
ln -s $base_resdir/Make*.out $resdir # for kvm-recheck.sh
|
||||||
|
ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
|
||||||
|
elif kvm-build.sh $config_template $builddir $T
|
||||||
|
then
|
||||||
|
# Had to build a kernel for this test.
|
||||||
QEMU="`identify_qemu $builddir/vmlinux`"
|
QEMU="`identify_qemu $builddir/vmlinux`"
|
||||||
BOOT_IMAGE="`identify_boot_image $QEMU`"
|
BOOT_IMAGE="`identify_boot_image $QEMU`"
|
||||||
cp $builddir/Make*.out $resdir
|
cp $builddir/Make*.out $resdir
|
||||||
|
cp $builddir/vmlinux $resdir
|
||||||
cp $builddir/.config $resdir
|
cp $builddir/.config $resdir
|
||||||
if test -n "$BOOT_IMAGE"
|
if test -n "$BOOT_IMAGE"
|
||||||
then
|
then
|
||||||
cp $builddir/$BOOT_IMAGE $resdir
|
cp $builddir/$BOOT_IMAGE $resdir
|
||||||
|
KERNEL=$resdir/bzImage
|
||||||
else
|
else
|
||||||
echo No identifiable boot image, not running KVM, see $resdir.
|
echo No identifiable boot image, not running KVM, see $resdir.
|
||||||
echo Do the torture scripts know about your architecture?
|
echo Do the torture scripts know about your architecture?
|
||||||
fi
|
fi
|
||||||
parse-build.sh $resdir/Make.out $title
|
parse-build.sh $resdir/Make.out $title
|
||||||
if test -f $builddir.wait
|
|
||||||
then
|
|
||||||
mv $builddir.wait $builddir.ready
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
|
# Build failed.
|
||||||
cp $builddir/Make*.out $resdir
|
cp $builddir/Make*.out $resdir
|
||||||
cp $builddir/.config $resdir || :
|
cp $builddir/.config $resdir || :
|
||||||
echo Build failed, not running KVM, see $resdir.
|
echo Build failed, not running KVM, see $resdir.
|
||||||
@ -119,6 +127,10 @@ else
|
|||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if test -f $builddir.wait
|
||||||
|
then
|
||||||
|
mv $builddir.wait $builddir.ready
|
||||||
|
fi
|
||||||
while test -f $builddir.ready
|
while test -f $builddir.ready
|
||||||
do
|
do
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -166,8 +178,8 @@ then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
|
echo "NOTE: $QEMU either did not run or was interactive" > $resdir/console.log
|
||||||
echo $QEMU $qemu_args -m 512 -kernel $resdir/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
|
echo $QEMU $qemu_args -m 512 -kernel $KERNEL -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
|
||||||
( $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 ) &
|
( $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 ) &
|
||||||
commandcompleted=0
|
commandcompleted=0
|
||||||
sleep 10 # Give qemu's pid a chance to reach the file
|
sleep 10 # Give qemu's pid a chance to reach the file
|
||||||
if test -s "$resdir/qemu_pid"
|
if test -s "$resdir/qemu_pid"
|
||||||
|
Loading…
Reference in New Issue
Block a user