[tip:core/rcu] rcutorture: Add per-version default Kconfig fragments and module parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  4275be83b807c2926d2b23e67eb61692a1810080
Gitweb:     http://git.kernel.org/tip/4275be83b807c2926d2b23e67eb61692a1810080
Author:     Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
AuthorDate: Sun, 29 Sep 2013 11:13:46 -0700
Committer:  Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Tue, 3 Dec 2013 10:11:11 -0800

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@xxxxxxxxxxxxxxxxxx>
Cc: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 .../testing/selftests/rcutorture/bin/functions.sh  |  7 ++---
 .../selftests/rcutorture/bin/kvm-test-1-rcu.sh     | 12 +++-----
 tools/testing/selftests/rcutorture/bin/kvm.sh      | 26 ++++++------------
 tools/testing/selftests/rcutorture/configs/CFLIST  | 17 ++++++++++++
 .../selftests/rcutorture/configs/v0.0/CFLIST       | 14 ++++++++++
 .../rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP    |  1 -
 .../rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP    |  1 -
 .../functions.sh => configs/v0.0/ver_functions.sh} | 27 +++++++-----------
 .../selftests/rcutorture/configs/v3.3/CFLIST       | 14 ++++++++++
 .../functions.sh => configs/v3.3/ver_functions.sh} | 27 +++++++++---------
 .../selftests/rcutorture/configs/v3.5/CFLIST       | 14 ++++++++++
 .../functions.sh => configs/v3.5/ver_functions.sh} | 32 ++++++++++++----------
 .../{bin/functions.sh => configs/ver_functions.sh} | 32 ++++++++++++----------
 13 files changed, 133 insertions(+), 91 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index db1c32a..d4c15f8 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -32,11 +32,10 @@ bootparam_hotplug_cpu () {
 #
 # Returns 1 if the config fragment specifies hotplug CPU.
 configfrag_hotplug_cpu () {
-	cf=$1
-	if test ! -r $cf
+	if test ! -r "$1"
 	then
-		echo Unreadable config fragment $cf 1>&2
+		echo Unreadable config fragment "$1" 1>&2
 		exit -1
 	fi
-	grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf
+	grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
 }
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 3b53078..0a3f037 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.$$
 trap 'rm -rf $T' 0
 
 . $KVM/bin/functions.sh
+. $KVPATH/ver_functions.sh
 
 config_template=${1}
 title=`echo $config_template | sed -e 's/^.*\///'`
@@ -133,14 +134,9 @@ else
 fi
 
 # Generate CPU-hotplug boot parameters
-if ! bootparam_hotplug_cpu "$bootargs"
-then
-	if configfrag_hotplug_cpu $builddir/.config
-	then
-		echo Kernel configured for CPU hotplug, adding rcutorture.
-		bootargs="$bootargs rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30"
-	fi
-fi
+boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
+# Generate rcu_barrier() boot parameter
+boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
 
 echo $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
 $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 7deb7b4..92f726b 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -33,23 +33,7 @@ dur=30
 KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM
 builddir=${KVM}/b1
 resdir=""
-configs=" sysidleY.2013.06.19a \
-	  sysidleN.2013.06.19a \
-	  P1-S-T-NH-SD-SMP-HP \
-	  P2-2-t-nh-sd-SMP-hp \
-	  P3-3-T-nh-SD-SMP-hp \
-	  P4-A-t-NH-sd-SMP-HP \
-	  P5-U-T-NH-sd-SMP-hp \
-	  P6---t-nh-SD-smp-hp \
-	  N1-S-T-NH-SD-SMP-HP \
-	  N2-2-t-nh-sd-SMP-hp \
-	  N3-3-T-nh-SD-SMP-hp \
-	  N4-A-t-NH-sd-SMP-HP \
-	  N5-U-T-NH-sd-SMP-hp \
-	  PT1-nh \
-	  PT2-NH \
-	  NT1-nh \
-	  NT3-NH"
+configs=""
 ds=`date +%Y.%m.%d-%H:%M:%S`
 kversion=""
 
@@ -156,6 +140,12 @@ echo "resdir=$resdir"
 
 PATH=${KVM}/bin:$PATH; export PATH
 CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
+KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
+
+if test -z "$configs"
+then
+	configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
+fi
 
 if test -z "$resdir"
 then
@@ -181,6 +171,6 @@ do
 	rd=$resdir/$ds/$CF
 	mkdir $rd || :
 	echo Results directory: $rd
-	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"
+	kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic" "rcutorture.test_no_idle_hz=1 rcutorture.verbose=1"
 done
 # 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 0000000..da4cbc66
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/CFLIST
@@ -0,0 +1,17 @@
+sysidleY.2013.06.19a
+sysidleN.2013.06.19a
+P1-S-T-NH-SD-SMP-HP
+P2-2-t-nh-sd-SMP-hp
+P3-3-T-nh-SD-SMP-hp
+P4-A-t-NH-sd-SMP-HP
+P5-U-T-NH-sd-SMP-hp
+P6---t-nh-SD-smp-hp
+N1-S-T-NH-SD-SMP-HP
+N2-2-t-nh-sd-SMP-hp
+N3-3-T-nh-SD-SMP-hp
+N4-A-t-NH-sd-SMP-HP
+N5-U-T-NH-sd-SMP-hp
+PT1-nh
+PT2-NH
+NT1-nh
+NT3-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 0000000..1822394
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST
@@ -0,0 +1,14 @@
+P1-S-T-NH-SD-SMP-HP
+P2-2-t-nh-sd-SMP-hp
+P3-3-T-nh-SD-SMP-hp
+P4-A-t-NH-sd-SMP-HP
+P5-U-T-NH-sd-SMP-hp
+N1-S-T-NH-SD-SMP-HP
+N2-2-t-nh-sd-SMP-hp
+N3-3-T-nh-SD-SMP-hp
+N4-A-t-NH-sd-SMP-HP
+N5-U-T-NH-sd-SMP-hp
+PT1-nh
+PT2-NH
+NT1-nh
+NT3-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 d81e11d..d3ef873 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 @@
 CONFIG_RCU_TRACE=y
-CONFIG_RCU_FAST_NO_HZ=y
 CONFIG_NO_HZ=y
 CONFIG_SMP=y
 CONFIG_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 9647c44..f72402d 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 @@
 CONFIG_RCU_TRACE=y
 CONFIG_RCU_CPU_STALL_INFO=y
 CONFIG_NO_HZ=y
-CONFIG_RCU_FAST_NO_HZ=y
 CONFIG_SMP=y
 CONFIG_RCU_FANOUT=8
 CONFIG_NR_CPUS=8
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
similarity index 61%
copy from tools/testing/selftests/rcutorture/bin/functions.sh
copy to tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
index db1c32a..af7d59b 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Shell functions for the rest of the scripts.
+# Kernel-version-dependent shell functions for the rest of the scripts.
 #
 # 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
@@ -20,23 +20,16 @@
 #
 # Authors: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
 
-# bootparam_hotplug_cpu bootparam-string
+# rcutorture_param_n_barrier_cbs bootparam-string
 #
-# Returns 1 if the specified boot-parameter string tells rcutorture to
-# test CPU-hotplug operations.
-bootparam_hotplug_cpu () {
-	echo "$1" | grep -q "rcutorture\.onoff_"
+# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
+rcutorture_param_n_barrier_cbs () {
+	echo $1
 }
 
-# configfrag_hotplug_cpu config-fragment-file
-#
-# Returns 1 if the config fragment specifies hotplug CPU.
-configfrag_hotplug_cpu () {
-	cf=$1
-	if test ! -r $cf
-	then
-		echo Unreadable config fragment $cf 1>&2
-		exit -1
-	fi
-	grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf
+# rcutorture_param_onoff bootparam-string config-file
+#
+# Adds onoff rcutorture module parameters to kernels having it.
+rcutorture_param_onoff () {
+	echo $1
 }
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 0000000..1822394
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST
@@ -0,0 +1,14 @@
+P1-S-T-NH-SD-SMP-HP
+P2-2-t-nh-sd-SMP-hp
+P3-3-T-nh-SD-SMP-hp
+P4-A-t-NH-sd-SMP-HP
+P5-U-T-NH-sd-SMP-hp
+N1-S-T-NH-SD-SMP-HP
+N2-2-t-nh-sd-SMP-hp
+N3-3-T-nh-SD-SMP-hp
+N4-A-t-NH-sd-SMP-HP
+N5-U-T-NH-sd-SMP-hp
+PT1-nh
+PT2-NH
+NT1-nh
+NT3-NH
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
similarity index 58%
copy from tools/testing/selftests/rcutorture/bin/functions.sh
copy to tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
index db1c32a..921fec9 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Shell functions for the rest of the scripts.
+# Kernel-version-dependent shell functions for the rest of the scripts.
 #
 # 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
@@ -20,23 +20,22 @@
 #
 # Authors: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
 
-# bootparam_hotplug_cpu bootparam-string
+# rcutorture_param_n_barrier_cbs bootparam-string
 #
-# Returns 1 if the specified boot-parameter string tells rcutorture to
-# test CPU-hotplug operations.
-bootparam_hotplug_cpu () {
-	echo "$1" | grep -q "rcutorture\.onoff_"
+# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
+rcutorture_param_n_barrier_cbs () {
+	echo $1
 }
 
-# configfrag_hotplug_cpu config-fragment-file
+# rcutorture_param_onoff bootparam-string config-file
 #
-# Returns 1 if the config fragment specifies hotplug CPU.
-configfrag_hotplug_cpu () {
-	cf=$1
-	if test ! -r $cf
+# Adds onoff rcutorture module parameters to kernels having it.
+rcutorture_param_onoff () {
+	if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
 	then
-		echo Unreadable config fragment $cf 1>&2
-		exit -1
+		echo CPU-hotplug kernel, adding rcutorture onoff.
+		echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
+	else
+		echo $1
 	fi
-	grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf
 }
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 0000000..1822394
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST
@@ -0,0 +1,14 @@
+P1-S-T-NH-SD-SMP-HP
+P2-2-t-nh-sd-SMP-hp
+P3-3-T-nh-SD-SMP-hp
+P4-A-t-NH-sd-SMP-HP
+P5-U-T-NH-sd-SMP-hp
+N1-S-T-NH-SD-SMP-HP
+N2-2-t-nh-sd-SMP-hp
+N3-3-T-nh-SD-SMP-hp
+N4-A-t-NH-sd-SMP-HP
+N5-U-T-NH-sd-SMP-hp
+PT1-nh
+PT2-NH
+NT1-nh
+NT3-NH
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
similarity index 54%
copy from tools/testing/selftests/rcutorture/bin/functions.sh
copy to tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
index db1c32a..4019744 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Shell functions for the rest of the scripts.
+# Kernel-version-dependent shell functions for the rest of the scripts.
 #
 # 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
@@ -20,23 +20,27 @@
 #
 # Authors: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
 
-# bootparam_hotplug_cpu bootparam-string
+# rcutorture_param_n_barrier_cbs bootparam-string
 #
-# Returns 1 if the specified boot-parameter string tells rcutorture to
-# test CPU-hotplug operations.
-bootparam_hotplug_cpu () {
-	echo "$1" | grep -q "rcutorture\.onoff_"
+# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
+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
+	fi
 }
 
-# configfrag_hotplug_cpu config-fragment-file
+# rcutorture_param_onoff bootparam-string config-file
 #
-# Returns 1 if the config fragment specifies hotplug CPU.
-configfrag_hotplug_cpu () {
-	cf=$1
-	if test ! -r $cf
+# Adds onoff rcutorture module parameters to kernels having it.
+rcutorture_param_onoff () {
+	if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
 	then
-		echo Unreadable config fragment $cf 1>&2
-		exit -1
+		echo CPU-hotplug kernel, adding rcutorture onoff.
+		echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
+	else
+		echo $1
 	fi
-	grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf
 }
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
similarity index 54%
copy from tools/testing/selftests/rcutorture/bin/functions.sh
copy to tools/testing/selftests/rcutorture/configs/ver_functions.sh
index db1c32a..f99f23b 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Shell functions for the rest of the scripts.
+# Kernel-version-dependent shell functions for the rest of the scripts.
 #
 # 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
@@ -20,23 +20,27 @@
 #
 # Authors: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
 
-# bootparam_hotplug_cpu bootparam-string
+# rcutorture_param_n_barrier_cbs bootparam-string
 #
-# Returns 1 if the specified boot-parameter string tells rcutorture to
-# test CPU-hotplug operations.
-bootparam_hotplug_cpu () {
-	echo "$1" | grep -q "rcutorture\.onoff_"
+# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
+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
+	fi
 }
 
-# configfrag_hotplug_cpu config-fragment-file
+# rcutorture_param_onoff bootparam-string config-file
 #
-# Returns 1 if the config fragment specifies hotplug CPU.
-configfrag_hotplug_cpu () {
-	cf=$1
-	if test ! -r $cf
+# Adds onoff rcutorture module parameters to kernels having it.
+rcutorture_param_onoff () {
+	if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
 	then
-		echo Unreadable config fragment $cf 1>&2
-		exit -1
+		echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
+		echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
+	else
+		echo $1
 	fi
-	grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux