aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-09-29 14:13:46 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-03 13:11:11 -0500
commit4275be83b807c2926d2b23e67eb61692a1810080 (patch)
tree8a38da9120e8e9d2ed4e797067e9afb8c91d19e8 /tools
parentbb918535a15a0c9ca217a99394dcae0c44711f1c (diff)
rcutorture: Add per-version default Kconfig fragments and module parameters
Different Kconfig parameters apply to different kernel versions, as do different rcutorture module parameters. This commit allows the rcutorture test scripts to adjust for different kernel versions. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Greg KH <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/rcutorture/bin/functions.sh7
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh12
-rw-r--r--tools/testing/selftests/rcutorture/bin/kvm.sh26
-rw-r--r--tools/testing/selftests/rcutorture/configs/CFLIST17
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP1
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP1
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh35
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh41
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh46
-rw-r--r--tools/testing/selftests/rcutorture/configs/ver_functions.sh46
13 files changed, 242 insertions, 32 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index db1c32acdcf6..d4c15f81cd27 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -32,11 +32,10 @@ bootparam_hotplug_cpu () {
32# 32#
33# Returns 1 if the config fragment specifies hotplug CPU. 33# Returns 1 if the config fragment specifies hotplug CPU.
34configfrag_hotplug_cpu () { 34configfrag_hotplug_cpu () {
35 cf=$1 35 if test ! -r "$1"
36 if test ! -r $cf
37 then 36 then
38 echo Unreadable config fragment $cf 1>&2 37 echo Unreadable config fragment "$1" 1>&2
39 exit -1 38 exit -1
40 fi 39 fi
41 grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf 40 grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
42} 41}
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 3b53078c5ff2..0a3f037a8bb3 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
@@ -44,6 +44,7 @@ T=/tmp/kvm-test-1-rcu.sh.$$
44trap 'rm -rf $T' 0 44trap 'rm -rf $T' 0
45 45
46. $KVM/bin/functions.sh 46. $KVM/bin/functions.sh
47. $KVPATH/ver_functions.sh
47 48
48config_template=${1} 49config_template=${1}
49title=`echo $config_template | sed -e 's/^.*\///'` 50title=`echo $config_template | sed -e 's/^.*\///'`
@@ -133,14 +134,9 @@ else
133fi 134fi
134 135
135# Generate CPU-hotplug boot parameters 136# Generate CPU-hotplug boot parameters
136if ! bootparam_hotplug_cpu "$bootargs" 137boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
137then 138# Generate rcu_barrier() boot parameter
138 if configfrag_hotplug_cpu $builddir/.config 139boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
139 then
140 echo Kernel configured for CPU hotplug, adding rcutorture.
141 bootargs="$bootargs rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30"
142 fi
143fi
144 140
145echo $QEMU -name rcu-test -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args\" > $resdir/qemu-cmd 141echo $QEMU -name rcu-test -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args\" > $resdir/qemu-cmd
146$QEMU -name rcu-test -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args" & 142$QEMU -name rcu-test -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args" &
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 7deb7b44d647..92f726b01044 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -33,23 +33,7 @@ dur=30
33KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM 33KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM
34builddir=${KVM}/b1 34builddir=${KVM}/b1
35resdir="" 35resdir=""
36configs=" sysidleY.2013.06.19a \ 36configs=""
37 sysidleN.2013.06.19a \
38 P1-S-T-NH-SD-SMP-HP \
39 P2-2-t-nh-sd-SMP-hp \
40 P3-3-T-nh-SD-SMP-hp \
41 P4-A-t-NH-sd-SMP-HP \
42 P5-U-T-NH-sd-SMP-hp \
43 P6---t-nh-SD-smp-hp \
44 N1-S-T-NH-SD-SMP-HP \
45 N2-2-t-nh-sd-SMP-hp \
46 N3-3-T-nh-SD-SMP-hp \
47 N4-A-t-NH-sd-SMP-HP \
48 N5-U-T-NH-sd-SMP-hp \
49 PT1-nh \
50 PT2-NH \
51 NT1-nh \
52 NT3-NH"
53ds=`date +%Y.%m.%d-%H:%M:%S` 37ds=`date +%Y.%m.%d-%H:%M:%S`
54kversion="" 38kversion=""
55 39
@@ -156,6 +140,12 @@ echo "resdir=$resdir"
156 140
157PATH=${KVM}/bin:$PATH; export PATH 141PATH=${KVM}/bin:$PATH; export PATH
158CONFIGFRAG=${KVM}/configs; export CONFIGFRAG 142CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
143KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
144
145if test -z "$configs"
146then
147 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
148fi
159 149
160if test -z "$resdir" 150if test -z "$resdir"
161then 151then
@@ -181,6 +171,6 @@ do
181 rd=$resdir/$ds/$CF 171 rd=$resdir/$ds/$CF
182 mkdir $rd || : 172 mkdir $rd || :
183 echo Results directory: $rd 173 echo Results directory: $rd
184 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic" "rcutorture.test_no_idle_hz=1 rcutorture.n_barrier_cbs=4 rcutorture.verbose=1" 174 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic" "rcutorture.test_no_idle_hz=1 rcutorture.verbose=1"
185done 175done
186# Tracing: trace_event=rcu:rcu_nocb_grace_period,rcu:rcu_grace_period,rcu:rcu_grace_period_init,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_torture_read,rcu:rcu_invoke_callback,rcu:rcu_fqs,rcu:rcu_dyntick,rcu:rcu_unlock_preempted_task 176# Tracing: trace_event=rcu:rcu_nocb_grace_period,rcu:rcu_grace_period,rcu:rcu_grace_period_init,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_torture_read,rcu:rcu_invoke_callback,rcu:rcu_fqs,rcu:rcu_dyntick,rcu:rcu_unlock_preempted_task
diff --git a/tools/testing/selftests/rcutorture/configs/CFLIST b/tools/testing/selftests/rcutorture/configs/CFLIST
new file mode 100644
index 000000000000..da4cbc668f2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/CFLIST
@@ -0,0 +1,17 @@
1sysidleY.2013.06.19a
2sysidleN.2013.06.19a
3P1-S-T-NH-SD-SMP-HP
4P2-2-t-nh-sd-SMP-hp
5P3-3-T-nh-SD-SMP-hp
6P4-A-t-NH-sd-SMP-HP
7P5-U-T-NH-sd-SMP-hp
8P6---t-nh-SD-smp-hp
9N1-S-T-NH-SD-SMP-HP
10N2-2-t-nh-sd-SMP-hp
11N3-3-T-nh-SD-SMP-hp
12N4-A-t-NH-sd-SMP-HP
13N5-U-T-NH-sd-SMP-hp
14PT1-nh
15PT2-NH
16NT1-nh
17NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST b/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP
index d81e11d280aa..d3ef873eb6e7 100644
--- a/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP
@@ -1,5 +1,4 @@
1CONFIG_RCU_TRACE=y 1CONFIG_RCU_TRACE=y
2CONFIG_RCU_FAST_NO_HZ=y
3CONFIG_NO_HZ=y 2CONFIG_NO_HZ=y
4CONFIG_SMP=y 3CONFIG_SMP=y
5CONFIG_RCU_FANOUT=8 4CONFIG_RCU_FANOUT=8
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP
index 9647c44cf4b7..f72402d7c13d 100644
--- a/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP
@@ -1,7 +1,6 @@
1CONFIG_RCU_TRACE=y 1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y 2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y 3CONFIG_NO_HZ=y
4CONFIG_RCU_FAST_NO_HZ=y
5CONFIG_SMP=y 4CONFIG_SMP=y
6CONFIG_RCU_FANOUT=8 5CONFIG_RCU_FANOUT=8
7CONFIG_NR_CPUS=8 6CONFIG_NR_CPUS=8
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
new file mode 100644
index 000000000000..af7d59bf0988
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
@@ -0,0 +1,35 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 echo $1
28}
29
30# rcutorture_param_onoff bootparam-string config-file
31#
32# Adds onoff rcutorture module parameters to kernels having it.
33rcutorture_param_onoff () {
34 echo $1
35}
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST b/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
new file mode 100644
index 000000000000..921fec931114
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
@@ -0,0 +1,41 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 echo $1
28}
29
30# rcutorture_param_onoff bootparam-string config-file
31#
32# Adds onoff rcutorture module parameters to kernels having it.
33rcutorture_param_onoff () {
34 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
35 then
36 echo CPU-hotplug kernel, adding rcutorture onoff.
37 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
38 else
39 echo $1
40 fi
41}
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST b/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
new file mode 100644
index 000000000000..401974455aee
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
28 then
29 echo $1
30 else
31 echo $1 rcutorture.n_barrier_cbs=4
32 fi
33}
34
35# rcutorture_param_onoff bootparam-string config-file
36#
37# Adds onoff rcutorture module parameters to kernels having it.
38rcutorture_param_onoff () {
39 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
40 then
41 echo CPU-hotplug kernel, adding rcutorture onoff.
42 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
43 else
44 echo $1
45 fi
46}
diff --git a/tools/testing/selftests/rcutorture/configs/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
new file mode 100644
index 000000000000..f99f23bc3934
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
28 then
29 echo $1
30 else
31 echo $1 rcutorture.n_barrier_cbs=4
32 fi
33}
34
35# rcutorture_param_onoff bootparam-string config-file
36#
37# Adds onoff rcutorture module parameters to kernels having it.
38rcutorture_param_onoff () {
39 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
40 then
41 echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
42 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
43 else
44 echo $1
45 fi
46}