Commit 4275be83 authored by Paul E. McKenney's avatar Paul E. McKenney

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
parent bb918535
...@@ -32,11 +32,10 @@ bootparam_hotplug_cpu () { ...@@ -32,11 +32,10 @@ bootparam_hotplug_cpu () {
# #
# Returns 1 if the config fragment specifies hotplug CPU. # Returns 1 if the config fragment specifies hotplug CPU.
configfrag_hotplug_cpu () { configfrag_hotplug_cpu () {
cf=$1 if test ! -r "$1"
if test ! -r $cf
then then
echo Unreadable config fragment $cf 1>&2 echo Unreadable config fragment "$1" 1>&2
exit -1 exit -1
fi fi
grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
} }
...@@ -44,6 +44,7 @@ T=/tmp/kvm-test-1-rcu.sh.$$ ...@@ -44,6 +44,7 @@ T=/tmp/kvm-test-1-rcu.sh.$$
trap 'rm -rf $T' 0 trap 'rm -rf $T' 0
. $KVM/bin/functions.sh . $KVM/bin/functions.sh
. $KVPATH/ver_functions.sh
config_template=${1} config_template=${1}
title=`echo $config_template | sed -e 's/^.*\///'` title=`echo $config_template | sed -e 's/^.*\///'`
...@@ -133,14 +134,9 @@ else ...@@ -133,14 +134,9 @@ else
fi fi
# Generate CPU-hotplug boot parameters # Generate CPU-hotplug boot parameters
if ! bootparam_hotplug_cpu "$bootargs" boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
then # Generate rcu_barrier() boot parameter
if configfrag_hotplug_cpu $builddir/.config boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
then
echo Kernel configured for CPU hotplug, adding rcutorture.
bootargs="$bootargs rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30"
fi
fi
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 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" & $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" &
......
...@@ -33,23 +33,7 @@ dur=30 ...@@ -33,23 +33,7 @@ dur=30
KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM
builddir=${KVM}/b1 builddir=${KVM}/b1
resdir="" resdir=""
configs=" sysidleY.2013.06.19a \ configs=""
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"
ds=`date +%Y.%m.%d-%H:%M:%S` ds=`date +%Y.%m.%d-%H:%M:%S`
kversion="" kversion=""
...@@ -156,6 +140,12 @@ echo "resdir=$resdir" ...@@ -156,6 +140,12 @@ echo "resdir=$resdir"
PATH=${KVM}/bin:$PATH; export PATH PATH=${KVM}/bin:$PATH; export PATH
CONFIGFRAG=${KVM}/configs; export CONFIGFRAG 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" if test -z "$resdir"
then then
...@@ -181,6 +171,6 @@ do ...@@ -181,6 +171,6 @@ do
rd=$resdir/$ds/$CF rd=$resdir/$ds/$CF
mkdir $rd || : mkdir $rd || :
echo Results directory: $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 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 # 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
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
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
CONFIG_RCU_TRACE=y CONFIG_RCU_TRACE=y
CONFIG_RCU_FAST_NO_HZ=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_RCU_FANOUT=8 CONFIG_RCU_FANOUT=8
......
CONFIG_RCU_TRACE=y CONFIG_RCU_TRACE=y
CONFIG_RCU_CPU_STALL_INFO=y CONFIG_RCU_CPU_STALL_INFO=y
CONFIG_NO_HZ=y CONFIG_NO_HZ=y
CONFIG_RCU_FAST_NO_HZ=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_RCU_FANOUT=8 CONFIG_RCU_FANOUT=8
CONFIG_NR_CPUS=8 CONFIG_NR_CPUS=8
......
#!/bin/bash
#
# 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
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright (C) IBM Corporation, 2013
#
# 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
}
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
#!/bin/bash
#
# 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
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright (C) IBM Corporation, 2013
#
# 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
fi
}
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
#!/bin/bash
#
# 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
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright (C) IBM Corporation, 2013
#
# 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 () {
if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
then
echo $1
else
echo $1 rcutorture.n_barrier_cbs=4
fi
}
# 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
fi
}
#!/bin/bash
#
# 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
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright (C) IBM Corporation, 2013
#
# 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 () {
if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
then
echo $1
else
echo $1 rcutorture.n_barrier_cbs=4
fi
}
# 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. 1>&2
echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
else
echo $1
fi
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment