blob: b5a5d6c15e78b1e57739a899408105302631d404 [file] [log] [blame]
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -07001#!/bin/bash
2#
3# Run a series of 14 tests under KVM. These are not particularly
4# well-selected or well-tuned, but are the current set. Run from the
5# top level of the source tree.
6#
7# Edit the definitions below to set the locations of the various directories,
8# as well as the test duration.
9#
10# Usage: sh kvm.sh [ options ]
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
Paul E. McKenney0e342a82013-12-03 09:54:18 -080023# along with this program; if not, you can access it online at
24# http://www.gnu.org/licenses/gpl-2.0.html.
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070025#
26# Copyright (C) IBM Corporation, 2011
27#
28# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
29
30scriptname=$0
Paul E. McKenney330a76f2013-09-30 14:49:43 -070031args="$*"
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070032
Paul E. McKenney43e38ab2014-01-15 15:48:41 -080033T=/tmp/kvm.sh.$$
34trap 'rm -rf $T' 0
35mkdir $T
36
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070037dur=30
Paul E. McKenneya7582812014-01-17 03:10:16 -080038dryrun=""
Paul E. McKenney73931b52013-10-15 10:42:25 -070039KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
Paul E. McKenney32caccb2013-10-28 08:57:29 -070040PATH=${KVM}/bin:$PATH; export PATH
Paul E. McKenney8c55f222014-02-26 14:28:43 -080041TORTURE_DEFCONFIG=defconfig
Paul E. McKenney2f66dbc2014-02-26 11:16:07 -080042TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
Paul E. McKenney58d280b2014-02-26 15:23:21 -080043TORTURE_KMAKE_ARG=""
Paul E. McKenney61010e72014-02-07 10:29:49 -080044TORTURE_SUITE=rcu
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070045resdir=""
Paul E. McKenney4275be82013-09-29 11:13:46 -070046configs=""
Paul E. McKenney43e38ab2014-01-15 15:48:41 -080047cpus=0
Paul E. McKenney847bfd22013-09-28 18:44:11 -070048ds=`date +%Y.%m.%d-%H:%M:%S`
Paul E. McKenneybb918532013-09-28 20:37:45 -070049kversion=""
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070050
Paul E. McKenney32caccb2013-10-28 08:57:29 -070051. functions.sh
52
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070053usage () {
54 echo "Usage: $scriptname optional arguments:"
Paul E. McKenney7dca9272013-10-14 08:19:39 -070055 echo " --bootargs kernel-boot-arguments"
Paul E. McKenney11274812013-10-10 14:52:07 -070056 echo " --buildonly"
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070057 echo " --configs \"config-file list\""
Paul E. McKenney43e38ab2014-01-15 15:48:41 -080058 echo " --cpus N"
Paul E. McKenney847bfd22013-09-28 18:44:11 -070059 echo " --datestamp string"
Paul E. McKenney8c55f222014-02-26 14:28:43 -080060 echo " --defconfig string"
Paul E. McKenneya7582812014-01-17 03:10:16 -080061 echo " --dryrun sched|script"
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070062 echo " --duration minutes"
Paul E. McKenney315c5402013-10-04 13:15:55 -070063 echo " --interactive"
Paul E. McKenney74878fb2013-10-15 11:51:23 -070064 echo " --kmake-arg kernel-make-arguments"
Paul E. McKenneybb918532013-09-28 20:37:45 -070065 echo " --kversion vN.NN"
Paul E. McKenney315c5402013-10-04 13:15:55 -070066 echo " --mac nn:nn:nn:nn:nn:nn"
Paul E. McKenney73931b52013-10-15 10:42:25 -070067 echo " --no-initrd"
Paul E. McKenneye9ce6402013-10-15 09:22:48 -070068 echo " --qemu-args qemu-system-..."
Paul E. McKenney4f8a0312013-09-30 17:17:57 -070069 echo " --qemu-cmd qemu-system-..."
Paul E. McKenney61010e72014-02-07 10:29:49 -080070 echo " --results absolute-pathname"
71 echo " --torture rcu"
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070072 exit 1
73}
74
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070075while test $# -gt 0
76do
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070077 case "$1" in
Paul E. McKenney7dca9272013-10-14 08:19:39 -070078 --bootargs)
79 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
Paul E. McKenney98bc8cc2014-02-26 15:28:53 -080080 TORTURE_BOOTARGS="$2"
Paul E. McKenney7dca9272013-10-14 08:19:39 -070081 shift
82 ;;
Paul E. McKenney11274812013-10-10 14:52:07 -070083 --buildonly)
Paul E. McKenney805ffee2014-02-26 15:39:41 -080084 TORTURE_BUILDONLY=1
Paul E. McKenney11274812013-10-10 14:52:07 -070085 ;;
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -070086 --configs)
87 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
88 configs="$2"
89 shift
90 ;;
Paul E. McKenney43e38ab2014-01-15 15:48:41 -080091 --cpus)
92 checkarg --cpus "(number)" "$#" "$2" '^[0-9]*$' '^--'
93 cpus=$2
94 shift
95 ;;
Paul E. McKenney847bfd22013-09-28 18:44:11 -070096 --datestamp)
97 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
98 ds=$2
99 shift
100 ;;
Paul E. McKenney8c55f222014-02-26 14:28:43 -0800101 --defconfig)
102 checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
103 TORTURE_DEFCONFIG=$2
104 shift
105 ;;
Paul E. McKenneya7582812014-01-17 03:10:16 -0800106 --dryrun)
107 checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
108 dryrun=$2
109 shift
110 ;;
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700111 --duration)
Paul E. McKenneye9ce6402013-10-15 09:22:48 -0700112 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700113 dur=$2
114 shift
115 ;;
Paul E. McKenney315c5402013-10-04 13:15:55 -0700116 --interactive)
Paul E. McKenneya0edd472014-02-26 16:38:52 -0800117 TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE
Paul E. McKenney315c5402013-10-04 13:15:55 -0700118 ;;
Paul E. McKenney74878fb2013-10-15 11:51:23 -0700119 --kmake-arg)
120 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
Paul E. McKenney58d280b2014-02-26 15:23:21 -0800121 TORTURE_KMAKE_ARG="$2"
Paul E. McKenney74878fb2013-10-15 11:51:23 -0700122 shift
123 ;;
Paul E. McKenneybb918532013-09-28 20:37:45 -0700124 --kversion)
Paul E. McKenneye9ce6402013-10-15 09:22:48 -0700125 checkarg --kversion "(kernel version)" $# "$2" '^v[0-9.]*$' '^error'
Paul E. McKenneybb918532013-09-28 20:37:45 -0700126 kversion=$2
127 shift
128 ;;
Paul E. McKenney315c5402013-10-04 13:15:55 -0700129 --mac)
130 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
Paul E. McKenney58f724f2014-02-26 16:41:18 -0800131 TORTURE_QEMU_MAC=$2
Paul E. McKenney315c5402013-10-04 13:15:55 -0700132 shift
133 ;;
Paul E. McKenney73931b52013-10-15 10:42:25 -0700134 --no-initrd)
Paul E. McKenney2f66dbc2014-02-26 11:16:07 -0800135 TORTURE_INITRD=""; export TORTURE_INITRD
Paul E. McKenney73931b52013-10-15 10:42:25 -0700136 ;;
Paul E. McKenneye9ce6402013-10-15 09:22:48 -0700137 --qemu-args)
138 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
Paul E. McKenneyd1b1e512014-02-26 16:42:46 -0800139 TORTURE_QEMU_ARG="$2"
Paul E. McKenneye9ce6402013-10-15 09:22:48 -0700140 shift
141 ;;
Paul E. McKenney4f8a0312013-09-30 17:17:57 -0700142 --qemu-cmd)
143 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
Paul E. McKenney250da312014-02-26 16:44:26 -0800144 TORTURE_QEMU_CMD="$2"
Paul E. McKenney4f8a0312013-09-30 17:17:57 -0700145 shift
146 ;;
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700147 --results)
Paul E. McKenneye9ce6402013-10-15 09:22:48 -0700148 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700149 resdir=$2
150 shift
151 ;;
Paul E. McKenney61010e72014-02-07 10:29:49 -0800152 --torture)
Paul E. McKenney9dfa5b32014-02-07 13:56:37 -0800153 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\)$' '^--'
Paul E. McKenney61010e72014-02-07 10:29:49 -0800154 TORTURE_SUITE=$2
155 shift
156 ;;
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700157 *)
Paul E. McKenney2bcdf4e2013-10-01 10:14:09 -0700158 echo Unknown argument $1
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700159 usage
160 ;;
161 esac
162 shift
163done
164
Paul E. McKenney61010e72014-02-07 10:29:49 -0800165CONFIGFRAG=${KVM}/configs/${TORTURE_SUITE}; export CONFIGFRAG
Paul E. McKenney4275be82013-09-29 11:13:46 -0700166KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
167
168if test -z "$configs"
169then
170 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
171fi
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700172
173if test -z "$resdir"
174then
175 resdir=$KVM/res
Paul E. McKenneydaeda232014-01-27 12:31:20 -0800176fi
177
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800178# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800179touch $T/cfgcpu
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700180for CF in $configs
181do
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800182 if test -f "$CONFIGFRAG/$kversion/$CF"
Paul E. McKenneyf43f8f72013-10-19 06:28:21 -0700183 then
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800184 echo $CF `configNR_CPUS.sh $CONFIGFRAG/$kversion/$CF` >> $T/cfgcpu
185 else
186 echo "The --configs file $CF does not exist, terminating."
187 exit 1
Paul E. McKenneyf43f8f72013-10-19 06:28:21 -0700188 fi
Paul E. McKenneyc87b9c62013-09-28 14:12:21 -0700189done
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800190sort -k2nr $T/cfgcpu > $T/cfgcpu.sort
191
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800192# Use a greedy bin-packing algorithm, sorting the list accordingly.
Paul E. McKenney53954672014-01-17 14:18:05 -0800193awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '
194BEGIN {
195 njobs = 0;
196}
197
198{
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800199 # Read file of tests and corresponding required numbers of CPUs.
Paul E. McKenney53954672014-01-17 14:18:05 -0800200 cf[njobs] = $1;
201 cpus[njobs] = $2;
202 njobs++;
203}
204
205END {
206 alldone = 0;
207 batch = 0;
208 nc = -1;
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800209
210 # Each pass through the following loop creates on test batch
211 # that can be executed concurrently given ncpus. Note that a
212 # given test that requires more than the available CPUs will run in
213 # their own batch. Such tests just have to make do with what
214 # is available.
Paul E. McKenney53954672014-01-17 14:18:05 -0800215 while (nc != ncpus) {
216 batch++;
217 nc = ncpus;
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800218
219 # Each pass through the following loop considers one
220 # test for inclusion in the current batch.
Paul E. McKenney53954672014-01-17 14:18:05 -0800221 for (i = 0; i < njobs; i++) {
222 if (done[i])
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800223 continue; # Already part of a batch.
Paul E. McKenney53954672014-01-17 14:18:05 -0800224 if (nc >= cpus[i] || nc == ncpus) {
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800225
226 # This test fits into the current batch.
Paul E. McKenney53954672014-01-17 14:18:05 -0800227 done[i] = batch;
228 nc -= cpus[i];
229 if (nc <= 0)
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800230 break; # Too-big test in its own batch.
Paul E. McKenney53954672014-01-17 14:18:05 -0800231 }
232 }
233 }
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800234
235 # Dump out the tests in batch order.
Paul E. McKenney53954672014-01-17 14:18:05 -0800236 for (b = 1; b <= batch; b++)
237 for (i = 0; i < njobs; i++)
238 if (done[i] == b)
239 print cf[i], cpus[i];
240}'
241
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800242# Generate a script to execute the tests in appropriate batches.
Paul E. McKenney61010e72014-02-07 10:29:49 -0800243cat << ___EOF___ > $T/script
244TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
Paul E. McKenney8c55f222014-02-26 14:28:43 -0800245TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
Paul E. McKenney1f5d0922014-02-27 17:11:11 -0800246if ! test -e $resdir
247then
248 mkdir -p "$resdir" || :
249fi
250mkdir $resdir/$ds
251echo Results directory: $resdir/$ds
252echo $scriptname $args
253touch $resdir/$ds/log
254echo $scriptname $args >> $resdir/$ds/log
255echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE
256pwd > $resdir/$ds/testid.txt
257if test -d .git
258then
259 git status >> $resdir/$ds/testid.txt
260 git rev-parse HEAD >> $resdir/$ds/testid.txt
261fi
Paul E. McKenney61010e72014-02-07 10:29:49 -0800262___EOF___
Paul E. McKenney53954672014-01-17 14:18:05 -0800263awk < $T/cfgcpu.pack \
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800264 -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
265 -v KVM="$KVM" \
266 -v ncpus=$cpus \
267 -v rd=$resdir/$ds/ \
268 -v dur=$dur \
Paul E. McKenneyd1b1e512014-02-26 16:42:46 -0800269 -v TORTURE_QEMU_ARG=$TORTURE_QEMU_ARG \
Paul E. McKenney98bc8cc2014-02-26 15:28:53 -0800270 -v TORTURE_BOOTARGS=$TORTURE_BOOTARGS \
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800271'BEGIN {
272 i = 0;
273}
274
275{
276 cf[i] = $1;
277 cpus[i] = $2;
278 i++;
279}
280
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800281# Dump out the scripting required to run one test batch.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800282function dump(first, pastlast)
283{
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800284 print "echo ----Start batch: `date`";
285 print "echo ----Start batch: `date` >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800286 jn=1
287 for (j = first; j < pastlast; j++) {
288 builddir=KVM "/b" jn
Paul E. McKenney0ae3f732014-01-17 03:29:12 -0800289 cpusr[jn] = cpus[j];
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800290 if (cfrep[cf[j]] == "") {
Paul E. McKenney0ae3f732014-01-17 03:29:12 -0800291 cfr[jn] = cf[j];
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800292 cfrep[cf[j]] = 1;
293 } else {
294 cfrep[cf[j]]++;
Paul E. McKenney0ae3f732014-01-17 03:29:12 -0800295 cfr[jn] = cf[j] "." cfrep[cf[j]];
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800296 }
Paul E. McKenneydf1cc812014-01-17 22:08:09 -0800297 if (cpusr[jn] > ncpus && ncpus != 0)
298 ovf = "(!)";
299 else
300 ovf = "";
Paul E. McKenney3c626232014-01-30 15:29:29 -0800301 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`";
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800302 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` >> " rd "/log";
Paul E. McKenney0ae3f732014-01-17 03:29:12 -0800303 print "rm -f " builddir ".*";
304 print "touch " builddir ".wait";
305 print "mkdir " builddir " > /dev/null 2>&1 || :";
306 print "mkdir " rd cfr[jn] " || :";
Paul E. McKenneyd1b1e512014-02-26 16:42:46 -0800307 print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800308 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`";
309 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800310 print "while test -f " builddir ".wait"
311 print "do"
312 print "\tsleep 1"
313 print "done"
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800314 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date`";
315 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800316 jn++;
317 }
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800318 for (j = 1; j < jn; j++) {
319 builddir=KVM "/b" j
320 print "rm -f " builddir ".ready"
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800321 print "echo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date`";
322 print "echo ----", cfr[j], cpusr[j] ovf ": Starting kernel. `date` >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800323 }
324 print "wait"
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800325 print "echo ---- All kernel runs complete. `date`";
326 print "echo ---- All kernel runs complete. `date` >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800327 for (j = 1; j < jn; j++) {
328 builddir=KVM "/b" j
Paul E. McKenney73fa8672014-02-11 12:16:14 -0800329 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results:";
330 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: >> " rd "/log";
331 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out";
332 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out >> " rd "/log";
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800333 }
334}
335
336END {
337 njobs = i;
338 nc = ncpus;
339 first = 0;
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800340
341 # Each pass through the following loop considers one test.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800342 for (i = 0; i < njobs; i++) {
343 if (ncpus == 0) {
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800344 # Sequential test specified, each test its own batch.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800345 dump(i, i + 1);
346 first = i;
347 } else if (nc < cpus[i] && i != 0) {
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800348 # Out of CPUs, dump out a batch.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800349 dump(first, i);
350 first = i;
351 nc = ncpus;
352 }
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800353 # Account for the CPUs needed by the current test.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800354 nc -= cpus[i];
355 }
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800356 # Dump the last batch.
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800357 if (ncpus != 0)
358 dump(first, i);
Paul E. McKenney61010e72014-02-07 10:29:49 -0800359}' >> $T/script
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800360
Paul E. McKenney1f5d0922014-02-27 17:11:11 -0800361cat << ___EOF___ >> $T/script
362echo
363echo
364echo " --- `date` Test summary:"
365echo Results directory: $resdir/$ds
366if test -z "$TORTURE_BUILDONLY"
367then
368 kvm-recheck.sh $resdir/$ds
369fi
370___EOF___
371
Paul E. McKenneya7582812014-01-17 03:10:16 -0800372if test "$dryrun" = script
373then
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800374 # Dump out the script, but define the environment variables that
375 # it needs to run standalone.
Paul E. McKenneya7582812014-01-17 03:10:16 -0800376 echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
377 echo KVM="$KVM; export KVM"
378 echo KVPATH="$KVPATH; export KVPATH"
379 echo PATH="$PATH; export PATH"
Paul E. McKenney805ffee2014-02-26 15:39:41 -0800380 echo TORTURE_BUILDONLY="$TORTURE_BUILDONLY; export TORTURE_BUILDONLY"
Paul E. McKenney2f66dbc2014-02-26 11:16:07 -0800381 echo TORTURE_INITRD="$TORTURE_INITRD; export TORTURE_INITRD"
Paul E. McKenney58d280b2014-02-26 15:23:21 -0800382 echo TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG; export TORTURE_KMAKE_ARG"
Paul E. McKenney250da312014-02-26 16:44:26 -0800383 echo TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD; export TORTURE_QEMU_CMD"
Paul E. McKenneya0edd472014-02-26 16:38:52 -0800384 echo TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE; export TORTURE_QEMU_INTERACTIVE"
Paul E. McKenney58f724f2014-02-26 16:41:18 -0800385 echo TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC; export TORTURE_QEMU_MAC"
Paul E. McKenneydaeda232014-01-27 12:31:20 -0800386 echo "mkdir -p "$resdir" || :"
387 echo "mkdir $resdir/$ds"
Paul E. McKenneya7582812014-01-17 03:10:16 -0800388 cat $T/script
389 exit 0
390elif test "$dryrun" = sched
391then
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800392 # Extract the test run schedule from the script.
Paul E. McKenney9352ad12014-02-26 09:10:26 -0800393 egrep 'Start batch|Starting build\.' $T/script |
394 grep -v ">>" |
Paul E. McKenneya7582812014-01-17 03:10:16 -0800395 sed -e 's/:.*$//' -e 's/^echo //'
396 exit 0
397else
Paul E. McKenney78ad0692014-01-17 21:56:57 -0800398 # Not a dryru, so run the script.
Paul E. McKenneya7582812014-01-17 03:10:16 -0800399 sh $T/script
400fi
Paul E. McKenney43e38ab2014-01-15 15:48:41 -0800401
Paul E. McKenney782ab4c2013-10-15 12:11:24 -0700402# Tracing: trace_event=rcu:rcu_grace_period,rcu:rcu_future_grace_period,rcu:rcu_grace_period_init,rcu:rcu_nocb_wake,rcu:rcu_preempt_task,rcu:rcu_unlock_preempted_task,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_kfree_callback,rcu:rcu_batch_start,rcu:rcu_invoke_callback,rcu:rcu_invoke_kfree_callback,rcu:rcu_batch_end,rcu:rcu_torture_read,rcu:rcu_barrier