Trivial fixup for KVM-based rcutorture test framework
Subsystems (2)
cover Trivial fixup for KVM-based rcutorture test framework
This patchset contains trivial fixup and enhancements for KVM-based rcutorture test framework.
SeongJae Park (9):
rcutorture/configinit: Fix build directory error message
rcutorture: Remove unused script, config2frag.sh rcutorture/kvm.sh: Remove unused variable, alldone rcutorture/kvm.sh: Use consistent usage for --qemu-args rcutorture/kvm.sh: Support execution from any directory rcutorture/kvm-recheck-*: Improve result directory readability check rcutorture/kvm-build.sh: Skip build directory check
rcutorture: Simplify logging
rcutorture: Simplify functions.sh include path
.../selftests/rcutorture/bin/config2frag.sh | 25 ------------- .../testing/selftests/rcutorture/bin/configinit.sh | 2 +- .../testing/selftests/rcutorture/bin/kvm-build.sh | 5 --- .../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +- .../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 4 +-- .../rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh | 2 +- .../rcutorture/bin/kvm-recheck-rcuperf.sh | 4 +-- .../selftests/rcutorture/bin/kvm-recheck.sh | 2 +- .../selftests/rcutorture/bin/kvm-test-1-run.sh | 6 ++-- tools/testing/selftests/rcutorture/bin/kvm.sh | 42 +++++++++------------- 10 files changed, 26 insertions(+), 68 deletions(-) delete mode 100755 tools/testing/selftests/rcutorture/bin/config2frag.sh
Signature · 1 line
2.13.0
PATCH 1/9 rcutorture/configinit: Fix build directory error message
'configinit.sh' checks format of optional argument for build directory and print error message if the format is not valid. However, the error message is broken so that it just says user entered empty string as build directory even though user entered wrong, but non-empty string as the argument. This commit fixes the message to show what user entered for the argument.
--- tools/testing/selftests/rcutorture/bin/configinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rcutorture/bin/configinit.sh +1 -1
@@ -51,7 +51,7 @@ then mkdir $builddir fi else - echo Bad build directory: \"$builddir\" + echo Bad build directory: \"$buildloc\" exit 2 fi fi
Signature · 1 line
2.13.0
PATCH 2/9 rcutorture: Remove unused script, config2frag.sh
In reply to SeongJae Park'config2frag.sh' is not used from anywhere. Just remove it.
--- .../selftests/rcutorture/bin/config2frag.sh | 25 ---------------------- 1 file changed, 25 deletions(-) delete mode 100755 tools/testing/selftests/rcutorture/bin/config2frag.sh
tools/testing/selftests/rcutorture/bin/config2frag.sh deleted +0 -25
@@ -1,25 +0,0 @@ -#!/bin/bash -# Usage: config2frag.sh < .config > configfrag -# -# Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the -# resulting file becomes a legitimate Kconfig fragment. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# Copyright (C) IBM Corporation, 2013 -# -# Authors: Paul E. McKenney <[email protected]> - -LANG=C sed -e 's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/'
Signature · 1 line
2.13.0
PATCH 3/9 rcutorture/kvm.sh: Remove unused variable, `alldone`
In reply to SeongJae ParkVariable alldone is defined but not used within an awk script. This commit removes it.
--- tools/testing/selftests/rcutorture/bin/kvm.sh | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/rcutorture/bin/kvm.sh +0 -1
@@ -238,7 +238,6 @@ BEGIN { } END { - alldone = 0; batch = 0; nc = -1;
Signature · 1 line
2.13.0
PATCH 4/9 rcutorture/kvm.sh: Use consistent usage for --qemu-args
In reply to SeongJae Park'--qemu-args' option usage is wrongly copied from '--qemu-cmd' option and it's argument type description message format is inconsistent with other arguments. This commit fixes the usage and type messages to be consistent with others.
--- tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm.sh +2 -2
@@ -70,7 +70,7 @@ usage () { echo " --kmake-arg kernel-make-arguments" echo " --mac nn:nn:nn:nn:nn:nn" echo " --no-initrd" - echo " --qemu-args qemu-system-..." + echo " --qemu-args qemu-arguments" echo " --qemu-cmd qemu-system-..." echo " --results absolute-pathname" echo " --torture rcu"
@@ -150,7 +150,7 @@ do TORTURE_INITRD=""; export TORTURE_INITRD ;; --qemu-args|--qemu-arg) - checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error' + checkarg --qemu-args "(qemu arguments)" $# "$2" '^-' '^error' TORTURE_QEMU_ARG="$2" shift ;;
Signature · 1 line
2.13.0
PATCH 5/9 rcutorture/kvm.sh: Support execution from any directory
In reply to SeongJae Park'kvm.sh' for rcutorture is restricting user to execute it from top of linux source tree. It is just a subtle restriction, but users using it for the first time could forget the restriction and be confused. Moreover, it makes commands a little longer and the long commands could frustrate debugging people. This commit let users to call the script from any location.
--- tools/testing/selftests/rcutorture/bin/kvm.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm.sh +3 -2
@@ -1,8 +1,7 @@ #!/bin/bash # # Run a series of 14 tests under KVM. These are not particularly -# well-selected or well-tuned, but are the current set. Run from the -# top level of the source tree. +# well-selected or well-tuned, but are the current set. # # Edit the definitions below to set the locations of the various directories, # as well as the test duration.
@@ -34,6 +33,8 @@ T=/tmp/kvm.sh.$$ trap 'rm -rf $T' 0 mkdir $T +cd `dirname $scriptname`/../../../../../ + dur=$((30*60)) dryrun="" KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
Signature · 1 line
2.13.0
PATCH 6/9 rcutorture/kvm-recheck-*: Improve result directory readability check
In reply to SeongJae Parkkvm-recheck-(lock|rcu|rcuperf).sh is checking whether user specified result directory exists or not. If not, it prints out error message that says the specified directory is not readable directory. To make the message more precise, this commit adds readability check of the directory.
--- tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh +1 -1
@@ -23,7 +23,7 @@ # Authors: Paul E. McKenney <[email protected]> i="$1" -if test -d $i +if test -d "$i" -a -r "$i" then : else
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh +1 -1
@@ -23,7 +23,7 @@ # Authors: Paul E. McKenney <[email protected]> i="$1" -if test -d $i +if test -d "$i" -a -r "$i" then : else
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh +1 -1
@@ -23,7 +23,7 @@ # Authors: Paul E. McKenney <[email protected]> i="$1" -if test -d $i +if test -d "$i" -a -r "$i" then : else
Signature · 1 line
2.13.0
PATCH 7/9 rcutorture/kvm-build.sh: Skip build directory check
In reply to SeongJae ParkCheck of existence and write permisison for build directory exists in 'kvm-test-1-run.sh' an 'kvm-build.sh'. Because the 'kvm-build.sh' is dependent to 'kvm-test-1-run.sh' ('kvm-build.sh' uses variables that defined from its caller.), it is an unnecessary duplicate. This commit removes, thus, the duplicated check in 'kvm-build.sh' script.
--- tools/testing/selftests/rcutorture/bin/kvm-build.sh | 5 ----- 1 file changed, 5 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm-build.sh +0 -5
@@ -29,11 +29,6 @@ then exit 1 fi builddir=${2} -if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir" -then - echo "kvm-build.sh :$builddir: Not a writable directory, cannot build into it" - exit 1 -fi T=/tmp/test-linux.sh.$$ trap 'rm -rf $T' 0
Signature · 1 line
2.13.0
PATCH 8/9 rcutorture: Simplify logging
In reply to SeongJae Park'kvm.sh' and 'kvm-test-1-run.sh' log messages by printing the message to 'stdout' then writing it into the log file. Generation of the message occurs twice once for 'stdout', and once for log file. It is redundant. Moreover, many of the messages are containing 'date' output inside the messages. Because the 'date' calculation also be called twice (once for stdout print, once for log file write), the date information in stdout and log file can be different. It could confuse some sensitive mind people.
This commit simplifies the logging procedure by using 'tee'.
--- .../selftests/rcutorture/bin/kvm-test-1-run.sh | 4 +-- tools/testing/selftests/rcutorture/bin/kvm.sh | 32 ++++++++-------------- 2 files changed, 12 insertions(+), 24 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh +1 -3
@@ -154,9 +154,7 @@ cpu_count=`configfrag_boot_cpus "$boot_args" "$config_template" "$cpu_count"` vcpus=`identify_qemu_vcpus` if test $cpu_count -gt $vcpus then - echo CPU count limited from $cpu_count to $vcpus - touch $resdir/Warnings - echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings + echo CPU count limited from $cpu_count to $vcpus | tee -a $resdir/Warnings cpu_count=$vcpus fi qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
tools/testing/selftests/rcutorture/bin/kvm.sh +11 -21
@@ -331,8 +331,7 @@ awk < $T/cfgcpu.pack \ # Dump out the scripting required to run one test batch. function dump(first, pastlast, batchnum) { - print "echo ----Start batch " batchnum ": `date`"; - print "echo ----Start batch " batchnum ": `date` >> " rd "/log"; + print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log"; print "needqemurun=" jn=1 for (j = first; j < pastlast; j++) {
@@ -349,21 +348,18 @@ function dump(first, pastlast, batchnum) ovf = "-ovf"; else ovf = ""; - print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`"; - print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` >> " rd "/log"; + print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log"; print "rm -f " builddir ".*"; print "touch " builddir ".wait"; print "mkdir " builddir " > /dev/null 2>&1 || :"; print "mkdir " rd cfr[jn] " || :"; 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 &" - print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`"; - print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log"; + print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log"; print "while test -f " builddir ".wait" print "do" print "\tsleep 1" print "done" - print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date`"; - print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` >> " rd "/log"; + print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log"; jn++; } for (j = 1; j < jn; j++) {
@@ -371,8 +367,7 @@ function dump(first, pastlast, batchnum) print "rm -f " builddir ".ready" print "if test -f \"" rd cfr[j] "/builtkernel\"" print "then" - print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date`"; - print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` >> " rd "/log"; + print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log"; print "\tneedqemurun=1" print "fi" }
@@ -386,31 +381,26 @@ function dump(first, pastlast, batchnum) njitter = ja[1]; if (TORTURE_BUILDONLY && njitter != 0) { njitter = 0; - print "echo Build-only run, so suppressing jitter >> " rd "/log" + print "echo Build-only run, so suppressing jitter | tee -a " rd "log" } if (TORTURE_BUILDONLY) { print "needqemurun=" } print "if test -n \"$needqemurun\"" print "then" - print "\techo ---- Starting kernels. `date`"; - print "\techo ---- Starting kernels. `date` >> " rd "/log"; + print "\techo ---- Starting kernels. `date` | tee -a " rd "log"; for (j = 0; j < njitter; j++) print "\tjitter.sh " j " " dur " " ja[2] " " ja[3] "&" print "\twait" - print "\techo ---- All kernel runs complete. `date`"; - print "\techo ---- All kernel runs complete. `date` >> " rd "/log"; + print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log"; print "else" print "\twait" - print "\techo ---- No kernel runs. `date`"; - print "\techo ---- No kernel runs. `date` >> " rd "/log"; + print "\techo ---- No kernel runs. `date` | tee -a " rd "log"; print "fi" for (j = 1; j < jn; j++) { builddir=KVM "/b" j - print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results:"; - print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: >> " rd "/log"; - print "cat " rd cfr[j] "/kvm-test-1-run.sh.out"; - print "cat " rd cfr[j] "/kvm-test-1-run.sh.out >> " rd "/log"; + print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log"; + print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log"; } }
Signature · 1 line
2.13.0
PATCH 9/9 rcutorture: Simplify functions.sh include path
In reply to SeongJae ParkInclusions of 'functions.sh' from 'kvm-test-1-run.sh' and 'kvm-recheck*.sh' are using its absolute path. Because directory for 'functions.sh' is already in PATH, however, it could be included without the full path. This commit simplifies the inclusions to use simple, short relative path.
--- tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-recheck.sh | 2 +- tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh +1 -1
@@ -30,7 +30,7 @@ else echo Unreadable results directory: $i exit 1 fi -. tools/testing/selftests/rcutorture/bin/functions.sh +. functions.sh configfile=`echo $i | sed -e 's/^.*\///'` ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh +1 -1
@@ -26,7 +26,7 @@ # Authors: Paul E. McKenney <[email protected]> i="$1" -. tools/testing/selftests/rcutorture/bin/functions.sh +. functions.sh if test "`grep -c 'rcu_exp_grace_period.*start' < $i/console.log`" -lt 100 then
tools/testing/selftests/rcutorture/bin/kvm-recheck-rcuperf.sh +1 -1
@@ -31,7 +31,7 @@ else exit 1 fi PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH -. tools/testing/selftests/rcutorture/bin/functions.sh +. functions.sh if kvm-recheck-rcuperf-ftrace.sh $i then
tools/testing/selftests/rcutorture/bin/kvm-recheck.sh +1 -1
@@ -25,7 +25,7 @@ # Authors: Paul E. McKenney <[email protected]> PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH -. tools/testing/selftests/rcutorture/bin/functions.sh +. functions.sh for rd in "$@" do firsttime=1
tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh +1 -1
@@ -42,7 +42,7 @@ T=/tmp/kvm-test-1-run.sh.$$ trap 'rm -rf $T' 0 mkdir $T -. $KVM/bin/functions.sh +. functions.sh . $CONFIGFRAG/ver_functions.sh config_template=${1}
Signature · 1 line
2.13.0
Quoted 2 lines · SeongJae Park
This patchset contains trivial fixup and enhancements for KVM-based rcutorture test framework.
Nice updates! These survived some rcutorture testing, so I have queued them for further testing and review. I did update the commit logs, and had to hand-apply one patch, so could you please double-check my -rcu tree to make sure that I didn't mess anything up?
Thanx, Paul
Quoted 27 lines
SeongJae Park (9):
rcutorture/configinit: Fix build directory error message
rcutorture: Remove unused script,config2frag.shrcutorture/kvm.sh: Remove unused variable,alldonercutorture/kvm.sh: Use consistent usage for --qemu-argsrcutorture/kvm.sh: Support execution from any directory rcutorture/kvm-recheck-*: Improve result directory readability checkrcutorture/kvm-build.sh: Skip build directory check
rcutorture: Simplify logging
rcutorture: Simplifyfunctions.shinclude path.../selftests/rcutorture/bin/config2frag.sh | 25 ------------- .../testing/selftests/rcutorture/bin/configinit.sh | 2 +- .../testing/selftests/rcutorture/bin/kvm-build.sh | 5 --- .../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +- .../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 4 +-- .../rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh | 2 +- .../rcutorture/bin/kvm-recheck-rcuperf.sh | 4 +-- .../selftests/rcutorture/bin/kvm-recheck.sh | 2 +- .../selftests/rcutorture/bin/kvm-test-1-run.sh | 6 ++-- tools/testing/selftests/rcutorture/bin/kvm.sh | 42 +++++++++------------- 10 files changed, 26 insertions(+), 68 deletions(-) delete mode 100755 tools/testing/selftests/rcutorture/bin/config2frag.shSignature · 1 line
2.13.0
Quoted 10 lines · Paul E. McKenney
Quoted 2 lines · SeongJae Park
This patchset contains trivial fixup and enhancements for KVM-based rcutorture test framework.
Nice updates! These survived some rcutorture testing, so I have queued them for further testing and review. I did update the commit logs, and had to hand-apply one patch, so could you please double-check my -rcu tree to make sure that I didn't mess anything up?
Thanx, Paul
Hello Paul,
I checked out the 'rcu/dev' branch of your '-rcu' tree. It looks like the commit logs are improved very well (thank you!) and the changes are applied completely as I intended.
Thanks,
SeongJae Park
Quoted 29 lines
Quoted 28 lines
SeongJae Park (9):
rcutorture/configinit: Fix build directory error message
rcutorture: Remove unused script,config2frag.shrcutorture/kvm.sh: Remove unused variable,alldonercutorture/kvm.sh: Use consistent usage for --qemu-argsrcutorture/kvm.sh: Support execution from any directory rcutorture/kvm-recheck-*: Improve result directory readability checkrcutorture/kvm-build.sh: Skip build directory check
rcutorture: Simplify logging
rcutorture: Simplifyfunctions.shinclude path.../selftests/rcutorture/bin/config2frag.sh | 25 ------------- .../testing/selftests/rcutorture/bin/configinit.sh | 2 +- .../testing/selftests/rcutorture/bin/kvm-build.sh | 5 --- .../selftests/rcutorture/bin/kvm-recheck-lock.sh | 2 +- .../selftests/rcutorture/bin/kvm-recheck-rcu.sh | 4 +-- .../rcutorture/bin/kvm-recheck-rcuperf-ftrace.sh | 2 +- .../rcutorture/bin/kvm-recheck-rcuperf.sh | 4 +-- .../selftests/rcutorture/bin/kvm-recheck.sh | 2 +- .../selftests/rcutorture/bin/kvm-test-1-run.sh | 6 ++-- tools/testing/selftests/rcutorture/bin/kvm.sh | 42 +++++++++------------- 10 files changed, 26 insertions(+), 68 deletions(-) delete mode 100755 tools/testing/selftests/rcutorture/bin/config2frag.sh--
2.13.0