]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rcutorture: Remove RCU dependencies from ver_functions.sh API
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 7 Feb 2014 01:50:32 +0000 (17:50 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 23 Feb 2014 17:04:33 +0000 (09:04 -0800)
The current set of functions in ver_functions.sh have APIs that are
specific to RCU.  This commit therefore makes an RCU-independent function
that outputs version-specific boot arguments.  This has the benefit that
a test-type-independent call in kvm-test-1-rcu.sh can now handle any type
of test, given a test-type-specific set of files in a configs directory.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
tools/testing/selftests/rcutorture/configs/ver_functions.sh

index 30cfbc8f3a0bcdf8132606ba33a0f41ca481b4bd..7986b3e7f318fdc167f059d458f9250997fceb5f 100755 (executable)
@@ -148,12 +148,8 @@ qemu_append="`identify_qemu_append "$QEMU"`"
 
 # Pull in Kconfig-fragment boot parameters
 boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
-# Generate CPU-hotplug boot parameters
-boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
-# Generate rcu_barrier() boot parameter
-boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
-# Pull in standard rcutorture boot arguments
-boot_args="$boot_args rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 rcutorture.test_no_idle_hz=1 rcutorture.verbose=1"
+# Generate kernel-version-specific boot parameters
+boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
 
 echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
 if test -n "$RCU_BUILDONLY"
index e8052539af54c9048584f490b5baf8ddf1dda180..5ace37a89780416fd2b8f27fc7d76dd5316e79ff 100644 (file)
 #
 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
 
-# rcutorture_param_n_barrier_cbs bootparam-string
-#
-# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
-rcutorture_param_n_barrier_cbs () {
-       echo $1
-}
-
-# rcutorture_param_onoff bootparam-string config-file
-#
-# Adds onoff rcutorture module parameters to kernels having it.
-rcutorture_param_onoff () {
-       echo $1
+# per_version_boot_params bootparam-string config-file seconds
+#
+# Adds per-version torture-module parameters to kernels supporting them.
+# Which old kernels do not.
+per_version_boot_params () {
+       echo    rcutorture.stat_interval=15 \
+               rcutorture.shutdown_secs=$3 \
+               rcutorture.rcutorture_runnable=1 \
+               rcutorture.test_no_idle_hz=1 \
+               rcutorture.verbose=1
 }
index c37432f3572c42a270a1d49b134644157ef5ce4b..bae55692ce6e36138dfddd9d5b13dddeac956508 100644 (file)
 #
 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
 
-# rcutorture_param_n_barrier_cbs bootparam-string
-#
-# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
-rcutorture_param_n_barrier_cbs () {
-       echo $1
-}
-
 # rcutorture_param_onoff bootparam-string config-file
 #
 # Adds onoff rcutorture module parameters to kernels having it.
 rcutorture_param_onoff () {
        if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
        then
-               echo CPU-hotplug kernel, adding rcutorture onoff.
-               echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
-       else
-               echo $1
+               echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
+               echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
        fi
 }
+
+# per_version_boot_params bootparam-string config-file seconds
+#
+# Adds per-version torture-module parameters to kernels supporting them.
+per_version_boot_params () {
+       echo $1 `rcutorture_param_onoff "$1" "$2"` \
+               rcutorture.stat_interval=15 \
+               rcutorture.shutdown_secs=$3 \
+               rcutorture.rcutorture_runnable=1 \
+               rcutorture.test_no_idle_hz=1 \
+               rcutorture.verbose=1
+}
index 6a5f13aab44d7d5863a04b601c7bb021072ea66b..8977d8d31b19f5215b9a9922f2b9c1c4b1e63fcd 100644 (file)
@@ -26,9 +26,9 @@
 rcutorture_param_n_barrier_cbs () {
        if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
        then
-               echo $1
+               :
        else
-               echo $1 rcutorture.n_barrier_cbs=4
+               echo rcutorture.n_barrier_cbs=4
        fi
 }
 
@@ -38,9 +38,20 @@ rcutorture_param_n_barrier_cbs () {
 rcutorture_param_onoff () {
        if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
        then
-               echo CPU-hotplug kernel, adding rcutorture onoff.
-               echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
-       else
-               echo $1
+               echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
+               echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
        fi
 }
+
+# per_version_boot_params bootparam-string config-file seconds
+#
+# Adds per-version torture-module parameters to kernels supporting them.
+per_version_boot_params () {
+       echo $1 `rcutorture_param_onoff "$1" "$2"` \
+               `rcutorture_param_n_barrier_cbs "$1"` \
+               rcutorture.stat_interval=15 \
+               rcutorture.shutdown_secs=$3 \
+               rcutorture.rcutorture_runnable=1 \
+               rcutorture.test_no_idle_hz=1 \
+               rcutorture.verbose=1
+}
index 5e40eadea77734d4497f711ca1f5d72aa03aa7bb..8977d8d31b19f5215b9a9922f2b9c1c4b1e63fcd 100644 (file)
@@ -26,9 +26,9 @@
 rcutorture_param_n_barrier_cbs () {
        if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
        then
-               echo $1
+               :
        else
-               echo $1 rcutorture.n_barrier_cbs=4
+               echo rcutorture.n_barrier_cbs=4
        fi
 }
 
@@ -39,8 +39,19 @@ rcutorture_param_onoff () {
        if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
        then
                echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
-               echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
-       else
-               echo $1
+               echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
        fi
 }
+
+# per_version_boot_params bootparam-string config-file seconds
+#
+# Adds per-version torture-module parameters to kernels supporting them.
+per_version_boot_params () {
+       echo $1 `rcutorture_param_onoff "$1" "$2"` \
+               `rcutorture_param_n_barrier_cbs "$1"` \
+               rcutorture.stat_interval=15 \
+               rcutorture.shutdown_secs=$3 \
+               rcutorture.rcutorture_runnable=1 \
+               rcutorture.test_no_idle_hz=1 \
+               rcutorture.verbose=1
+}