diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-01-17 06:10:16 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-18 15:26:35 -0500 |
commit | a7582815b98c843e6468cad82d01a6c084ed4072 (patch) | |
tree | b3357c4e90dd6b950a79519f716a3bc36b158bce /tools/testing | |
parent | db007ab5ce155c90d89220495ee17213f66b7241 (diff) |
rcutorture: Add dryrun capability
Actual rcutorture tests take considerable time and machine resources,
so it is inconvenient to actually do an rcutorture run when optimizing
the bin-packing algorithm. This commit therefore adds a --dryrun
argument, which defaults to doing a run, but for which "sched"
says to simply print the run schedule and "script" dumps the script
without running it.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/rcutorture/bin/kvm.sh | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index f74f00628afe..9fab7c8e76f0 100644 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh | |||
@@ -35,6 +35,7 @@ trap 'rm -rf $T' 0 | |||
35 | mkdir $T | 35 | mkdir $T |
36 | 36 | ||
37 | dur=30 | 37 | dur=30 |
38 | dryrun="" | ||
38 | KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM | 39 | KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM |
39 | PATH=${KVM}/bin:$PATH; export PATH | 40 | PATH=${KVM}/bin:$PATH; export PATH |
40 | builddir="${KVM}/b1" | 41 | builddir="${KVM}/b1" |
@@ -56,6 +57,7 @@ usage () { | |||
56 | echo " --configs \"config-file list\"" | 57 | echo " --configs \"config-file list\"" |
57 | echo " --cpus N" | 58 | echo " --cpus N" |
58 | echo " --datestamp string" | 59 | echo " --datestamp string" |
60 | echo " --dryrun sched|script" | ||
59 | echo " --duration minutes" | 61 | echo " --duration minutes" |
60 | echo " --interactive" | 62 | echo " --interactive" |
61 | echo " --kmake-arg kernel-make-arguments" | 63 | echo " --kmake-arg kernel-make-arguments" |
@@ -101,6 +103,11 @@ do | |||
101 | ds=$2 | 103 | ds=$2 |
102 | shift | 104 | shift |
103 | ;; | 105 | ;; |
106 | --dryrun) | ||
107 | checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--' | ||
108 | dryrun=$2 | ||
109 | shift | ||
110 | ;; | ||
104 | --duration) | 111 | --duration) |
105 | checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error' | 112 | checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error' |
106 | dur=$2 | 113 | dur=$2 |
@@ -179,9 +186,12 @@ else | |||
179 | fi | 186 | fi |
180 | fi | 187 | fi |
181 | mkdir $resdir/$ds | 188 | mkdir $resdir/$ds |
182 | echo Results directory: $resdir/$ds | 189 | if test "$dryrun" = "" |
190 | then | ||
191 | echo Results directory: $resdir/$ds | ||
192 | echo $scriptname $args | ||
193 | fi | ||
183 | touch $resdir/$ds/log | 194 | touch $resdir/$ds/log |
184 | echo $scriptname $args | ||
185 | echo $scriptname $args >> $resdir/$ds/log | 195 | echo $scriptname $args >> $resdir/$ds/log |
186 | 196 | ||
187 | pwd > $resdir/$ds/testid.txt | 197 | pwd > $resdir/$ds/testid.txt |
@@ -231,7 +241,7 @@ function dump(first, pastlast) | |||
231 | print "echo ", cf[j], cpus[j] ": Starting build." | 241 | print "echo ", cf[j], cpus[j] ": Starting build." |
232 | print "rm -f " builddir ".*" | 242 | print "rm -f " builddir ".*" |
233 | print "touch " builddir ".wait" | 243 | print "touch " builddir ".wait" |
234 | print "mkdir " builddir " || :" | 244 | print "mkdir " builddir " > /dev/null 2>&1 || :" |
235 | if (cfrep[cf[j]] == "") { | 245 | if (cfrep[cf[j]] == "") { |
236 | cfr[j] = cf[j]; | 246 | cfr[j] = cf[j]; |
237 | cfrep[cf[j]] = 1; | 247 | cfrep[cf[j]] = 1; |
@@ -286,7 +296,28 @@ END { | |||
286 | dump(first, i); | 296 | dump(first, i); |
287 | }' > $T/script | 297 | }' > $T/script |
288 | 298 | ||
289 | sh $T/script | 299 | if test "$dryrun" = script |
300 | then | ||
301 | echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG" | ||
302 | echo KVM="$KVM; export KVM" | ||
303 | echo KVPATH="$KVPATH; export KVPATH" | ||
304 | echo PATH="$PATH; export PATH" | ||
305 | echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY" | ||
306 | echo RCU_INITRD="$RCU_INITRD; export RCU_INITRD" | ||
307 | echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG" | ||
308 | echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD" | ||
309 | echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE" | ||
310 | echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC" | ||
311 | cat $T/script | ||
312 | exit 0 | ||
313 | elif test "$dryrun" = sched | ||
314 | then | ||
315 | egrep 'start batch|Starting build\.' $T/script | | ||
316 | sed -e 's/:.*$//' -e 's/^echo //' | ||
317 | exit 0 | ||
318 | else | ||
319 | sh $T/script | ||
320 | fi | ||
290 | 321 | ||
291 | # 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 | 322 | # 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 |
292 | 323 | ||