diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-27 20:11:11 -0500 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-05-14 12:45:55 -0400 |
| commit | 1f5d09205f8c12de4b3d612259fb2ec6464ba8ff (patch) | |
| tree | 4eeae395587b6b5bec9301b911deb4848d397dcd /tools/testing | |
| parent | b3b8a4d42bba8e1fb1b91cc6fd53829d28a503de (diff) | |
torture: Make "--dryrun script" output self-sufficient
The scripts produced by kvm.sh's "--dryrun script" argument were intended
for debugging rather than to run, but it is easier to debug if the script
output matches exactly what is run. This commit therefore makes this
script runnable.
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 | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index 41162012037b..b5a5d6c15e78 100644 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh | |||
| @@ -175,30 +175,6 @@ then | |||
| 175 | resdir=$KVM/res | 175 | resdir=$KVM/res |
| 176 | fi | 176 | fi |
| 177 | 177 | ||
| 178 | if test "$dryrun" = "" | ||
| 179 | then | ||
| 180 | if ! test -e $resdir | ||
| 181 | then | ||
| 182 | mkdir -p "$resdir" || : | ||
| 183 | fi | ||
| 184 | mkdir $resdir/$ds | ||
| 185 | |||
| 186 | # Be noisy only if running the script. | ||
| 187 | echo Results directory: $resdir/$ds | ||
| 188 | echo $scriptname $args | ||
| 189 | |||
| 190 | touch $resdir/$ds/log | ||
| 191 | echo $scriptname $args >> $resdir/$ds/log | ||
| 192 | echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE | ||
| 193 | |||
| 194 | pwd > $resdir/$ds/testid.txt | ||
| 195 | if test -d .git | ||
| 196 | then | ||
| 197 | git status >> $resdir/$ds/testid.txt | ||
| 198 | git rev-parse HEAD >> $resdir/$ds/testid.txt | ||
| 199 | fi | ||
| 200 | fi | ||
| 201 | |||
| 202 | # Create a file of test-name/#cpus pairs, sorted by decreasing #cpus. | 178 | # Create a file of test-name/#cpus pairs, sorted by decreasing #cpus. |
| 203 | touch $T/cfgcpu | 179 | touch $T/cfgcpu |
| 204 | for CF in $configs | 180 | for CF in $configs |
| @@ -267,6 +243,22 @@ END { | |||
| 267 | cat << ___EOF___ > $T/script | 243 | cat << ___EOF___ > $T/script |
| 268 | TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE | 244 | TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE |
| 269 | TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG | 245 | TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG |
| 246 | if ! test -e $resdir | ||
| 247 | then | ||
| 248 | mkdir -p "$resdir" || : | ||
| 249 | fi | ||
| 250 | mkdir $resdir/$ds | ||
| 251 | echo Results directory: $resdir/$ds | ||
| 252 | echo $scriptname $args | ||
| 253 | touch $resdir/$ds/log | ||
| 254 | echo $scriptname $args >> $resdir/$ds/log | ||
| 255 | echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE | ||
| 256 | pwd > $resdir/$ds/testid.txt | ||
| 257 | if test -d .git | ||
| 258 | then | ||
| 259 | git status >> $resdir/$ds/testid.txt | ||
| 260 | git rev-parse HEAD >> $resdir/$ds/testid.txt | ||
| 261 | fi | ||
| 270 | ___EOF___ | 262 | ___EOF___ |
| 271 | awk < $T/cfgcpu.pack \ | 263 | awk < $T/cfgcpu.pack \ |
| 272 | -v CONFIGDIR="$CONFIGFRAG/$kversion/" \ | 264 | -v CONFIGDIR="$CONFIGFRAG/$kversion/" \ |
| @@ -366,6 +358,17 @@ END { | |||
| 366 | dump(first, i); | 358 | dump(first, i); |
| 367 | }' >> $T/script | 359 | }' >> $T/script |
| 368 | 360 | ||
| 361 | cat << ___EOF___ >> $T/script | ||
| 362 | echo | ||
| 363 | echo | ||
| 364 | echo " --- `date` Test summary:" | ||
| 365 | echo Results directory: $resdir/$ds | ||
| 366 | if test -z "$TORTURE_BUILDONLY" | ||
| 367 | then | ||
| 368 | kvm-recheck.sh $resdir/$ds | ||
| 369 | fi | ||
| 370 | ___EOF___ | ||
| 371 | |||
| 369 | if test "$dryrun" = script | 372 | if test "$dryrun" = script |
| 370 | then | 373 | then |
| 371 | # Dump out the script, but define the environment variables that | 374 | # Dump out the script, but define the environment variables that |
| @@ -397,12 +400,3 @@ else | |||
| 397 | fi | 400 | fi |
| 398 | 401 | ||
| 399 | # 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 | 402 | # 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 |
| 400 | |||
| 401 | echo | ||
| 402 | echo | ||
| 403 | echo " --- `date` Test summary:" | ||
| 404 | echo Results directory: $resdir/$ds | ||
| 405 | if test -n "$TORTURE_BUILDONLY" | ||
| 406 | then | ||
| 407 | kvm-recheck.sh $resdir/$ds | ||
| 408 | fi | ||
