Commit 3d2cc4fe authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Add "scenarios" option to kvm.sh --dryrun parameter

This commit adds "--dryrun scenarios" to kvm.sh, which prints something
like this:

1.  TREE03
2.  TREE07
3.  SRCU-P SRCU-N
4.  TREE01 TRACE01
5.  TREE02 TRACE02
6.  TREE04 RUDE01 TASKS01
7.  TREE05 TASKS03 SRCU-T SRCU-U
8.  TASKS02 TINY01 TINY02 TREE09

This format is more convenient for scripts that run batches of scenarios.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 98da7719
...@@ -64,7 +64,7 @@ usage () { ...@@ -64,7 +64,7 @@ usage () {
echo " --cpus N" echo " --cpus N"
echo " --datestamp string" echo " --datestamp string"
echo " --defconfig string" echo " --defconfig string"
echo " --dryrun batches|sched|script" echo " --dryrun batches|scenarios|sched|script"
echo " --duration minutes | <seconds>s | <hours>h | <days>d" echo " --duration minutes | <seconds>s | <hours>h | <days>d"
echo " --gdb" echo " --gdb"
echo " --help" echo " --help"
...@@ -130,7 +130,7 @@ do ...@@ -130,7 +130,7 @@ do
shift shift
;; ;;
--dryrun) --dryrun)
checkarg --dryrun "batches|sched|script" $# "$2" 'batches\|sched\|script' '^--' checkarg --dryrun "batches|sched|script" $# "$2" 'batches\|scenarios\|sched\|script' '^--'
dryrun=$2 dryrun=$2
shift shift
;; ;;
...@@ -577,6 +577,25 @@ egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" | ...@@ -577,6 +577,25 @@ egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
print batchno, $1, $2 print batchno, $1, $2
}' > $T/batches }' > $T/batches
# As above, but one line per batch.
grep -v '^#' $T/batches | awk '
BEGIN {
oldbatch = 1;
}
{
if (oldbatch != $1) {
print ++n ". " curbatch;
curbatch = "";
oldbatch = $1;
}
curbatch = curbatch " " $2;
}
END {
print ++n ". " curbatch;
}' > $T/scenarios
if test "$dryrun" = script if test "$dryrun" = script
then then
cat $T/script cat $T/script
...@@ -597,11 +616,16 @@ elif test "$dryrun" = batches ...@@ -597,11 +616,16 @@ elif test "$dryrun" = batches
then then
cat $T/batches cat $T/batches
exit 0 exit 0
elif test "$dryrun" = scenarios
then
cat $T/scenarios
exit 0
else else
# Not a dryrun. Record the batches and the number of CPUs, then run the script. # Not a dryrun. Record the batches and the number of CPUs, then run the script.
bash $T/script bash $T/script
ret=$? ret=$?
cp $T/batches $resdir/$ds/batches cp $T/batches $resdir/$ds/batches
cp $T/scenarios $resdir/$ds/scenarios
echo '#' cpus=$cpus >> $resdir/$ds/batches echo '#' cpus=$cpus >> $resdir/$ds/batches
echo " --- Done at `date` (`get_starttime_duration $starttime`) exitcode $ret" | tee -a $resdir/$ds/log echo " --- Done at `date` (`get_starttime_duration $starttime`) exitcode $ret" | tee -a $resdir/$ds/log
exit $ret exit $ret
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment