mirror of https://gitee.com/openkylin/linux.git
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
|
||||
#
|
||||
# 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.
|
||||
# Exits with 0 if all went well, with 1 if all went well but the config
|
||||
|
@ -40,9 +40,8 @@ mkdir $T
|
|||
|
||||
c=$1
|
||||
buildloc=$2
|
||||
resdir=$3
|
||||
builddir=
|
||||
if test -n $buildloc
|
||||
then
|
||||
if echo $buildloc | grep -q '^O='
|
||||
then
|
||||
builddir=`echo $buildloc | sed -e 's/^O=//'`
|
||||
|
@ -54,19 +53,18 @@ then
|
|||
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
|
||||
grep '^grep' < $T/u.sh > $T/upd.sh
|
||||
echo "cat - $c" >> $T/upd.sh
|
||||
make mrproper
|
||||
make $buildloc distclean > $builddir/Make.distclean 2>&1
|
||||
make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
|
||||
make $buildloc distclean > $resdir/Make.distclean 2>&1
|
||||
make $buildloc $TORTURE_DEFCONFIG > $resdir/Make.defconfig.out 2>&1
|
||||
mv $builddir/.config $builddir/.config.sav
|
||||
sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
|
||||
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.
|
||||
configcheck.sh $builddir/.config $c
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# 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
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,6 +29,7 @@ then
|
|||
exit 1
|
||||
fi
|
||||
builddir=${2}
|
||||
resdir=${3}
|
||||
|
||||
T=${TMPDIR-/tmp}/test-linux.sh.$$
|
||||
trap 'rm -rf $T' 0
|
||||
|
@ -41,19 +42,19 @@ CONFIG_VIRTIO_PCI=y
|
|||
CONFIG_VIRTIO_CONSOLE=y
|
||||
___EOF___
|
||||
|
||||
configinit.sh $T/config O=$builddir
|
||||
configinit.sh $T/config O=$builddir $resdir
|
||||
retval=$?
|
||||
if test $retval -gt 1
|
||||
then
|
||||
exit 2
|
||||
fi
|
||||
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=$?
|
||||
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
|
||||
echo Kernel build error
|
||||
egrep "Stop|Error|error:|warning:" < $builddir/Make.out
|
||||
egrep "Stop|Error|error:|warning:" < $resdir/Make.out
|
||||
echo Run aborted.
|
||||
exit 3
|
||||
fi
|
||||
|
|
|
@ -98,14 +98,15 @@ then
|
|||
ln -s $base_resdir/.config $resdir # for kvm-recheck.sh
|
||||
# Arch-independent indicator
|
||||
touch $resdir/builtkernel
|
||||
elif kvm-build.sh $T/Kc2 $builddir
|
||||
elif kvm-build.sh $T/Kc2 $builddir $resdir
|
||||
then
|
||||
# Had to build a kernel for this test.
|
||||
QEMU="`identify_qemu $builddir/vmlinux`"
|
||||
BOOT_IMAGE="`identify_boot_image $QEMU`"
|
||||
cp $builddir/Make*.out $resdir
|
||||
cp $builddir/vmlinux $resdir
|
||||
cp $builddir/.config $resdir
|
||||
cp $builddir/Module.symvers $resdir > /dev/null || :
|
||||
cp $builddir/System.map $resdir > /dev/null || :
|
||||
if test -n "$BOOT_IMAGE"
|
||||
then
|
||||
cp $builddir/$BOOT_IMAGE $resdir
|
||||
|
|
|
@ -347,7 +347,7 @@ function dump(first, pastlast, batchnum)
|
|||
print "needqemurun="
|
||||
jn=1
|
||||
for (j = first; j < pastlast; j++) {
|
||||
builddir=KVM "/b" jn
|
||||
builddir=KVM "/b1"
|
||||
cpusr[jn] = cpus[j];
|
||||
if (cfrep[cf[j]] == "") {
|
||||
cfr[jn] = cf[j];
|
||||
|
|
Loading…
Reference in New Issue