diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-06 20:50:32 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-23 12:04:33 -0500 |
commit | a5afdeb13c86564bdbd27e8d154933fb65ea2426 (patch) | |
tree | 86be8c692bdcaf3f2992f86970badc366d689c27 | |
parent | d2ebf7eea0d3fd450ca5b1cb2243fe1d69d399ce (diff) |
rcutorture: Remove RCU dependencies from ver_functions.sh API
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>
5 files changed, 59 insertions, 40 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh index 30cfbc8f3a0b..7986b3e7f318 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | |||
@@ -148,12 +148,8 @@ qemu_append="`identify_qemu_append "$QEMU"`" | |||
148 | 148 | ||
149 | # Pull in Kconfig-fragment boot parameters | 149 | # Pull in Kconfig-fragment boot parameters |
150 | boot_args="`configfrag_boot_params "$boot_args" "$config_template"`" | 150 | boot_args="`configfrag_boot_params "$boot_args" "$config_template"`" |
151 | # Generate CPU-hotplug boot parameters | 151 | # Generate kernel-version-specific boot parameters |
152 | boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`" | 152 | boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`" |
153 | # Generate rcu_barrier() boot parameter | ||
154 | boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`" | ||
155 | # Pull in standard rcutorture boot arguments | ||
156 | 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" | ||
157 | 153 | ||
158 | echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd | 154 | echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd |
159 | if test -n "$RCU_BUILDONLY" | 155 | if test -n "$RCU_BUILDONLY" |
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh index e8052539af54..5ace37a89780 100644 --- a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh | |||
@@ -20,16 +20,14 @@ | |||
20 | # | 20 | # |
21 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 21 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
22 | 22 | ||
23 | # rcutorture_param_n_barrier_cbs bootparam-string | 23 | # per_version_boot_params bootparam-string config-file seconds |
24 | # | 24 | # |
25 | # Adds n_barrier_cbs rcutorture module parameter to kernels having it. | 25 | # Adds per-version torture-module parameters to kernels supporting them. |
26 | rcutorture_param_n_barrier_cbs () { | 26 | # Which old kernels do not. |
27 | echo $1 | 27 | per_version_boot_params () { |
28 | } | 28 | echo rcutorture.stat_interval=15 \ |
29 | 29 | rcutorture.shutdown_secs=$3 \ | |
30 | # rcutorture_param_onoff bootparam-string config-file | 30 | rcutorture.rcutorture_runnable=1 \ |
31 | # | 31 | rcutorture.test_no_idle_hz=1 \ |
32 | # Adds onoff rcutorture module parameters to kernels having it. | 32 | rcutorture.verbose=1 |
33 | rcutorture_param_onoff () { | ||
34 | echo $1 | ||
35 | } | 33 | } |
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh index c37432f3572c..bae55692ce6e 100644 --- a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh | |||
@@ -20,22 +20,25 @@ | |||
20 | # | 20 | # |
21 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 21 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
22 | 22 | ||
23 | # rcutorture_param_n_barrier_cbs bootparam-string | ||
24 | # | ||
25 | # Adds n_barrier_cbs rcutorture module parameter to kernels having it. | ||
26 | rcutorture_param_n_barrier_cbs () { | ||
27 | echo $1 | ||
28 | } | ||
29 | |||
30 | # rcutorture_param_onoff bootparam-string config-file | 23 | # rcutorture_param_onoff bootparam-string config-file |
31 | # | 24 | # |
32 | # Adds onoff rcutorture module parameters to kernels having it. | 25 | # Adds onoff rcutorture module parameters to kernels having it. |
33 | rcutorture_param_onoff () { | 26 | rcutorture_param_onoff () { |
34 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" | 27 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" |
35 | then | 28 | then |
36 | echo CPU-hotplug kernel, adding rcutorture onoff. | 29 | echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2 |
37 | echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 | 30 | echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 |
38 | else | ||
39 | echo $1 | ||
40 | fi | 31 | fi |
41 | } | 32 | } |
33 | |||
34 | # per_version_boot_params bootparam-string config-file seconds | ||
35 | # | ||
36 | # Adds per-version torture-module parameters to kernels supporting them. | ||
37 | per_version_boot_params () { | ||
38 | echo $1 `rcutorture_param_onoff "$1" "$2"` \ | ||
39 | rcutorture.stat_interval=15 \ | ||
40 | rcutorture.shutdown_secs=$3 \ | ||
41 | rcutorture.rcutorture_runnable=1 \ | ||
42 | rcutorture.test_no_idle_hz=1 \ | ||
43 | rcutorture.verbose=1 | ||
44 | } | ||
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh index 6a5f13aab44d..8977d8d31b19 100644 --- a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh | |||
@@ -26,9 +26,9 @@ | |||
26 | rcutorture_param_n_barrier_cbs () { | 26 | rcutorture_param_n_barrier_cbs () { |
27 | if echo $1 | grep -q "rcutorture\.n_barrier_cbs" | 27 | if echo $1 | grep -q "rcutorture\.n_barrier_cbs" |
28 | then | 28 | then |
29 | echo $1 | 29 | : |
30 | else | 30 | else |
31 | echo $1 rcutorture.n_barrier_cbs=4 | 31 | echo rcutorture.n_barrier_cbs=4 |
32 | fi | 32 | fi |
33 | } | 33 | } |
34 | 34 | ||
@@ -38,9 +38,20 @@ rcutorture_param_n_barrier_cbs () { | |||
38 | rcutorture_param_onoff () { | 38 | rcutorture_param_onoff () { |
39 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" | 39 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" |
40 | then | 40 | then |
41 | echo CPU-hotplug kernel, adding rcutorture onoff. | 41 | echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2 |
42 | echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 | 42 | echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 |
43 | else | ||
44 | echo $1 | ||
45 | fi | 43 | fi |
46 | } | 44 | } |
45 | |||
46 | # per_version_boot_params bootparam-string config-file seconds | ||
47 | # | ||
48 | # Adds per-version torture-module parameters to kernels supporting them. | ||
49 | per_version_boot_params () { | ||
50 | echo $1 `rcutorture_param_onoff "$1" "$2"` \ | ||
51 | `rcutorture_param_n_barrier_cbs "$1"` \ | ||
52 | rcutorture.stat_interval=15 \ | ||
53 | rcutorture.shutdown_secs=$3 \ | ||
54 | rcutorture.rcutorture_runnable=1 \ | ||
55 | rcutorture.test_no_idle_hz=1 \ | ||
56 | rcutorture.verbose=1 | ||
57 | } | ||
diff --git a/tools/testing/selftests/rcutorture/configs/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/ver_functions.sh index 5e40eadea777..8977d8d31b19 100644 --- a/tools/testing/selftests/rcutorture/configs/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/ver_functions.sh | |||
@@ -26,9 +26,9 @@ | |||
26 | rcutorture_param_n_barrier_cbs () { | 26 | rcutorture_param_n_barrier_cbs () { |
27 | if echo $1 | grep -q "rcutorture\.n_barrier_cbs" | 27 | if echo $1 | grep -q "rcutorture\.n_barrier_cbs" |
28 | then | 28 | then |
29 | echo $1 | 29 | : |
30 | else | 30 | else |
31 | echo $1 rcutorture.n_barrier_cbs=4 | 31 | echo rcutorture.n_barrier_cbs=4 |
32 | fi | 32 | fi |
33 | } | 33 | } |
34 | 34 | ||
@@ -39,8 +39,19 @@ rcutorture_param_onoff () { | |||
39 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" | 39 | if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2" |
40 | then | 40 | then |
41 | echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2 | 41 | echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2 |
42 | echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 | 42 | echo rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30 |
43 | else | ||
44 | echo $1 | ||
45 | fi | 43 | fi |
46 | } | 44 | } |
45 | |||
46 | # per_version_boot_params bootparam-string config-file seconds | ||
47 | # | ||
48 | # Adds per-version torture-module parameters to kernels supporting them. | ||
49 | per_version_boot_params () { | ||
50 | echo $1 `rcutorture_param_onoff "$1" "$2"` \ | ||
51 | `rcutorture_param_n_barrier_cbs "$1"` \ | ||
52 | rcutorture.stat_interval=15 \ | ||
53 | rcutorture.shutdown_secs=$3 \ | ||
54 | rcutorture.rcutorture_runnable=1 \ | ||
55 | rcutorture.test_no_idle_hz=1 \ | ||
56 | rcutorture.verbose=1 | ||
57 | } | ||