mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
rcutorture: Permit kvm-again.sh to re-use the build directory
This commit adds "inplace" and "inplace-force" values to the kvm-again.sh "--link" argument, which causes the run's output to be placed into the build directory. This could be used to save build time if the machine went down partway into a run, but it can also be used to do a large number of builds, and run the resulting kernels concurrently even if the builds are based on different commits. A later commit will add this latter capability to kvm-series.sh in order to produce large speedups for branch-checking operations. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
This commit is contained in:
committed by
Frederic Weisbecker
parent
515a48fedc
commit
f121fbbdaf
@@ -31,7 +31,7 @@ fi
|
|||||||
if ! cp "$oldrun/scenarios" $T/scenarios.oldrun
|
if ! cp "$oldrun/scenarios" $T/scenarios.oldrun
|
||||||
then
|
then
|
||||||
# Later on, can reconstitute this from console.log files.
|
# Later on, can reconstitute this from console.log files.
|
||||||
echo Prior run batches file does not exist: $oldrun/batches
|
echo Prior run scenarios file does not exist: $oldrun/scenarios
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ usage () {
|
|||||||
echo " --datestamp string"
|
echo " --datestamp string"
|
||||||
echo " --dryrun"
|
echo " --dryrun"
|
||||||
echo " --duration minutes | <seconds>s | <hours>h | <days>d"
|
echo " --duration minutes | <seconds>s | <hours>h | <days>d"
|
||||||
echo " --link hard|soft|copy"
|
echo " --link hard|soft|copy|inplace|inplace-force"
|
||||||
echo " --remote"
|
echo " --remote"
|
||||||
echo " --rundir /new/res/path"
|
echo " --rundir /new/res/path"
|
||||||
echo "Command line: $scriptname $args"
|
echo "Command line: $scriptname $args"
|
||||||
@@ -121,7 +121,7 @@ do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--link)
|
--link)
|
||||||
checkarg --link "hard|soft|copy" "$#" "$2" 'hard\|soft\|copy' '^--'
|
checkarg --link "hard|soft|copy|inplace|inplace-force" "$#" "$2" 'hard\|soft\|copy\|inplace\|inplace-force' '^--'
|
||||||
case "$2" in
|
case "$2" in
|
||||||
copy)
|
copy)
|
||||||
arg_link="cp -R"
|
arg_link="cp -R"
|
||||||
@@ -132,6 +132,14 @@ do
|
|||||||
soft)
|
soft)
|
||||||
arg_link="cp -Rs"
|
arg_link="cp -Rs"
|
||||||
;;
|
;;
|
||||||
|
inplace)
|
||||||
|
arg_link="inplace"
|
||||||
|
rundir="$oldrun"
|
||||||
|
;;
|
||||||
|
inplace-force)
|
||||||
|
arg_link="inplace-force"
|
||||||
|
rundir="$oldrun"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@@ -172,21 +180,37 @@ fi
|
|||||||
|
|
||||||
echo ---- Re-run results directory: $rundir
|
echo ---- Re-run results directory: $rundir
|
||||||
|
|
||||||
# Copy old run directory tree over and adjust.
|
if test "$oldrun" != "$rundir"
|
||||||
mkdir -p "`dirname "$rundir"`"
|
|
||||||
if ! $arg_link "$oldrun" "$rundir"
|
|
||||||
then
|
then
|
||||||
echo "Cannot copy from $oldrun to $rundir."
|
# Copy old run directory tree over and adjust.
|
||||||
usage
|
mkdir -p "`dirname "$rundir"`"
|
||||||
fi
|
if ! $arg_link "$oldrun" "$rundir"
|
||||||
rm -f "$rundir"/*/{console.log,console.log.diags,qemu_pid,qemu-pid,qemu-retval,Warnings,kvm-test-1-run.sh.out,kvm-test-1-run-qemu.sh.out,vmlinux} "$rundir"/log
|
then
|
||||||
touch "$rundir/log"
|
echo "Cannot copy from $oldrun to $rundir."
|
||||||
echo $scriptname $args | tee -a "$rundir/log"
|
usage
|
||||||
echo $oldrun > "$rundir/re-run"
|
fi
|
||||||
if ! test -d "$rundir/../../bin"
|
rm -f "$rundir"/*/{console.log,console.log.diags,qemu_pid,qemu-pid,qemu-retval,Warnings,kvm-test-1-run.sh.out,kvm-test-1-run-qemu.sh.out,vmlinux} "$rundir"/log
|
||||||
then
|
touch "$rundir/log"
|
||||||
$arg_link "$oldrun/../../bin" "$rundir/../.."
|
echo $scriptname $args | tee -a "$rundir/log"
|
||||||
|
echo $oldrun > "$rundir/re-run"
|
||||||
|
if ! test -d "$rundir/../../bin"
|
||||||
|
then
|
||||||
|
$arg_link "$oldrun/../../bin" "$rundir/../.."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Check for a run having already happened.
|
||||||
|
find "$rundir" -name console.log -print > $T/oldrun-console.log
|
||||||
|
if test -s $T/oldrun-console.log
|
||||||
|
then
|
||||||
|
echo Run already took place in $rundir
|
||||||
|
if test "$arg_link" = inplace
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Find runs to be done based on their qemu-cmd files.
|
||||||
for i in $rundir/*/qemu-cmd
|
for i in $rundir/*/qemu-cmd
|
||||||
do
|
do
|
||||||
cp "$i" $T
|
cp "$i" $T
|
||||||
|
|||||||
Reference in New Issue
Block a user