torture: Use a single build directory for torture scenarios
The torture scripting currently builds each kernel from a set of parallel runs in its own build directory. This can waste quite a bit of space when running large numbers of concurrent scenarios, and pointlessly given that the builds are run sequentially (albeit with a largish -j number passed to "make"). This commit therefore places all build-command output in the results directory, then does all builds in a single "b1" build directory. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
ce397d215c
commit
5bfd7d34fe
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Usage: configinit.sh config-spec-file [ build output dir ]
|
# Usage: configinit.sh config-spec-file build-output-dir results-dir
|
||||||
#
|
#
|
||||||
# Create a .config file from the spec file. Run from the kernel source tree.
|
# Create a .config file from the spec file. Run from the kernel source tree.
|
||||||
# Exits with 0 if all went well, with 1 if all went well but the config
|
# Exits with 0 if all went well, with 1 if all went well but the config
|
||||||
@ -40,20 +40,18 @@ mkdir $T
|
|||||||
|
|
||||||
c=$1
|
c=$1
|
||||||
buildloc=$2
|
buildloc=$2
|
||||||
|
resdir=$3
|
||||||
builddir=
|
builddir=
|
||||||
if test -n $buildloc
|
if echo $buildloc | grep -q '^O='
|
||||||
then
|
then
|
||||||
if echo $buildloc | grep -q '^O='
|
builddir=`echo $buildloc | sed -e 's/^O=//'`
|
||||||
|
if test ! -d $builddir
|
||||||
then
|
then
|
||||||
builddir=`echo $buildloc | sed -e 's/^O=//'`
|
mkdir $builddir
|
||||||
if test ! -d $builddir
|
|
||||||
then
|
|
||||||
mkdir $builddir
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo Bad build directory: \"$buildloc\"
|
|
||||||
exit 2
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo Bad build directory: \"$buildloc\"
|
||||||
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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
|
||||||
@ -61,12 +59,12 @@ sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh
|
|||||||
grep '^grep' < $T/u.sh > $T/upd.sh
|
grep '^grep' < $T/u.sh > $T/upd.sh
|
||||||
echo "cat - $c" >> $T/upd.sh
|
echo "cat - $c" >> $T/upd.sh
|
||||||
make mrproper
|
make mrproper
|
||||||
make $buildloc distclean > $builddir/Make.distclean 2>&1
|
make $buildloc distclean > $resdir/Make.distclean 2>&1
|
||||||
make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
|
make $buildloc $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
|
||||||
mv $builddir/.config $builddir/.config.sav
|
mv $builddir/.config $builddir/.config.sav
|
||||||
sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
|
sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
|
||||||
cp $builddir/.config $builddir/.config.new
|
cp $builddir/.config $builddir/.config.new
|
||||||
yes '' | make $buildloc oldconfig > $builddir/Make.oldconfig.out 2> $builddir/Make.oldconfig.err
|
yes '' | make $buildloc oldconfig > $resdir/Make.oldconfig.out 2> $resdir/Make.oldconfig.err
|
||||||
|
|
||||||
# verify new config matches specification.
|
# verify new config matches specification.
|
||||||
configcheck.sh $builddir/.config $c
|
configcheck.sh $builddir/.config $c
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Build a kvm-ready Linux kernel from the tree in the current directory.
|
# Build a kvm-ready Linux kernel from the tree in the current directory.
|
||||||
#
|
#
|
||||||
# Usage: kvm-build.sh config-template build-dir
|
# Usage: kvm-build.sh config-template build-dir resdir
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -29,6 +29,7 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
builddir=${2}
|
builddir=${2}
|
||||||
|
resdir=${3}
|
||||||
|
|
||||||
T=${TMPDIR-/tmp}/test-linux.sh.$$
|
T=${TMPDIR-/tmp}/test-linux.sh.$$
|
||||||
trap 'rm -rf $T' 0
|
trap 'rm -rf $T' 0
|
||||||
@ -41,19 +42,19 @@ CONFIG_VIRTIO_PCI=y
|
|||||||
CONFIG_VIRTIO_CONSOLE=y
|
CONFIG_VIRTIO_CONSOLE=y
|
||||||
___EOF___
|
___EOF___
|
||||||
|
|
||||||
configinit.sh $T/config O=$builddir
|
configinit.sh $T/config O=$builddir $resdir
|
||||||
retval=$?
|
retval=$?
|
||||||
if test $retval -gt 1
|
if test $retval -gt 1
|
||||||
then
|
then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
ncpus=`cpus2use.sh`
|
ncpus=`cpus2use.sh`
|
||||||
make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $builddir/Make.out 2>&1
|
make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
|
||||||
retval=$?
|
retval=$?
|
||||||
if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
|
if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
|
||||||
then
|
then
|
||||||
echo Kernel build error
|
echo Kernel build error
|
||||||
egrep "Stop|Error|error:|warning:" < $builddir/Make.out
|
egrep "Stop|Error|error:|warning:" < $resdir/Make.out
|
||||||
echo Run aborted.
|
echo Run aborted.
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
@ -98,14 +98,15 @@ then
|
|||||||
ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
|
ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
|
||||||
# Arch-independent indicator
|
# Arch-independent indicator
|
||||||
touch $resdir/builtkernel
|
touch $resdir/builtkernel
|
||||||
elif kvm-build.sh $T/Kc2 $builddir
|
elif kvm-build.sh $T/Kc2 $builddir $resdir
|
||||||
then
|
then
|
||||||
# Had to build a kernel for this test.
|
# 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/vmlinux $resdir
|
cp $builddir/vmlinux $resdir
|
||||||
cp $builddir/.config $resdir
|
cp $builddir/.config $resdir
|
||||||
|
cp $builddir/Module.symvers $resdir > /dev/null || :
|
||||||
|
cp $builddir/System.map $resdir > /dev/null || :
|
||||||
if test -n "$BOOT_IMAGE"
|
if test -n "$BOOT_IMAGE"
|
||||||
then
|
then
|
||||||
cp $builddir/$BOOT_IMAGE $resdir
|
cp $builddir/$BOOT_IMAGE $resdir
|
||||||
|
@ -347,7 +347,7 @@ function dump(first, pastlast, batchnum)
|
|||||||
print "needqemurun="
|
print "needqemurun="
|
||||||
jn=1
|
jn=1
|
||||||
for (j = first; j < pastlast; j++) {
|
for (j = first; j < pastlast; j++) {
|
||||||
builddir=KVM "/b" jn
|
builddir=KVM "/b1"
|
||||||
cpusr[jn] = cpus[j];
|
cpusr[jn] = cpus[j];
|
||||||
if (cfrep[cf[j]] == "") {
|
if (cfrep[cf[j]] == "") {
|
||||||
cfr[jn] = cf[j];
|
cfr[jn] = cf[j];
|
||||||
|
Loading…
Reference in New Issue
Block a user