aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj38.park@gmail.com>2017-11-03 06:17:27 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-12-11 12:18:26 -0500
commitfa48beb5f485a82a15f777198c770feb6d01c794 (patch)
tree043479f79ae750564889b2313ef3ce1aa4534f44
parent81394e3f6df8f72895354fe29a1ef60cb0765a78 (diff)
rcutorture: Simplify logging
Both the 'kvm.sh' and 'kvm-test-1-run.sh' scripts log messages by printing the message to 'stdout' and then also printing it into the log file. Generation of the message thus occurs twice, once for 'stdout' and once for the log file. Moreover, many of the messages contain 'date' output, which results in date being invoked twice (once for stdout print, once for log file write). As a result, the date information in stdout and log file can differ, which could cause confusion. This commit therefore simplifies the logging procedure by using 'tee'. Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh4
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh32
2 files changed, 12 insertions, 24 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index ab14b97c942c..0406c67378cb 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -154,9 +154,7 @@ cpu_count=`configfrag_boot_cpus "$boot_args" "$config_template" "$cpu_count"`
154vcpus=`identify_qemu_vcpus` 154vcpus=`identify_qemu_vcpus`
155if test $cpu_count -gt $vcpus 155if test $cpu_count -gt $vcpus
156then 156then
157 echo CPU count limited from $cpu_count to $vcpus 157 echo CPU count limited from $cpu_count to $vcpus | tee -a $resdir/Warnings
158 touch $resdir/Warnings
159 echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings
160 cpu_count=$vcpus 158 cpu_count=$vcpus
161fi 159fi
162qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`" 160qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index d2a4fd94de6a..7d1f607f0f76 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -331,8 +331,7 @@ awk < $T/cfgcpu.pack \
331# Dump out the scripting required to run one test batch. 331# Dump out the scripting required to run one test batch.
332function dump(first, pastlast, batchnum) 332function dump(first, pastlast, batchnum)
333{ 333{
334 print "echo ----Start batch " batchnum ": `date`"; 334 print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log";
335 print "echo ----Start batch " batchnum ": `date` >> " rd "/log";
336 print "needqemurun=" 335 print "needqemurun="
337 jn=1 336 jn=1
338 for (j = first; j < pastlast; j++) { 337 for (j = first; j < pastlast; j++) {
@@ -349,21 +348,18 @@ function dump(first, pastlast, batchnum)
349 ovf = "-ovf"; 348 ovf = "-ovf";
350 else 349 else
351 ovf = ""; 350 ovf = "";
352 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`"; 351 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log";
353 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` >> " rd "/log";
354 print "rm -f " builddir ".*"; 352 print "rm -f " builddir ".*";
355 print "touch " builddir ".wait"; 353 print "touch " builddir ".wait";
356 print "mkdir " builddir " > /dev/null 2>&1 || :"; 354 print "mkdir " builddir " > /dev/null 2>&1 || :";
357 print "mkdir " rd cfr[jn] " || :"; 355 print "mkdir " rd cfr[jn] " || :";
358 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 &" 356 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 &"
359 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`"; 357 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
360 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log";
361 print "while test -f " builddir ".wait" 358 print "while test -f " builddir ".wait"
362 print "do" 359 print "do"
363 print "\tsleep 1" 360 print "\tsleep 1"
364 print "done" 361 print "done"
365 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date`"; 362 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
366 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` >> " rd "/log";
367 jn++; 363 jn++;
368 } 364 }
369 for (j = 1; j < jn; j++) { 365 for (j = 1; j < jn; j++) {
@@ -371,8 +367,7 @@ function dump(first, pastlast, batchnum)
371 print "rm -f " builddir ".ready" 367 print "rm -f " builddir ".ready"
372 print "if test -f \"" rd cfr[j] "/builtkernel\"" 368 print "if test -f \"" rd cfr[j] "/builtkernel\""
373 print "then" 369 print "then"
374 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date`"; 370 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log";
375 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` >> " rd "/log";
376 print "\tneedqemurun=1" 371 print "\tneedqemurun=1"
377 print "fi" 372 print "fi"
378 } 373 }
@@ -386,31 +381,26 @@ function dump(first, pastlast, batchnum)
386 njitter = ja[1]; 381 njitter = ja[1];
387 if (TORTURE_BUILDONLY && njitter != 0) { 382 if (TORTURE_BUILDONLY && njitter != 0) {
388 njitter = 0; 383 njitter = 0;
389 print "echo Build-only run, so suppressing jitter >> " rd "/log" 384 print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
390 } 385 }
391 if (TORTURE_BUILDONLY) { 386 if (TORTURE_BUILDONLY) {
392 print "needqemurun=" 387 print "needqemurun="
393 } 388 }
394 print "if test -n \"$needqemurun\"" 389 print "if test -n \"$needqemurun\""
395 print "then" 390 print "then"
396 print "\techo ---- Starting kernels. `date`"; 391 print "\techo ---- Starting kernels. `date` | tee -a " rd "log";
397 print "\techo ---- Starting kernels. `date` >> " rd "/log";
398 for (j = 0; j < njitter; j++) 392 for (j = 0; j < njitter; j++)
399 print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&" 393 print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&"
400 print "\twait" 394 print "\twait"
401 print "\techo ---- All kernel runs complete. `date`"; 395 print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log";
402 print "\techo ---- All kernel runs complete. `date` >> " rd "/log";
403 print "else" 396 print "else"
404 print "\twait" 397 print "\twait"
405 print "\techo ---- No kernel runs. `date`"; 398 print "\techo ---- No kernel runs. `date` | tee -a " rd "log";
406 print "\techo ---- No kernel runs. `date` >> " rd "/log";
407 print "fi" 399 print "fi"
408 for (j = 1; j < jn; j++) { 400 for (j = 1; j < jn; j++) {
409 builddir=KVM "/b" j 401 builddir=KVM "/b" j
410 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results:"; 402 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log";
411 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: >> " rd "/log"; 403 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log";
412 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out";
413 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out >> " rd "/log";
414 } 404 }
415} 405}
416 406