aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 15:35:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 15:35:05 -0400
commit59a3d4c3631e553357b7305dc09db1990aa6757c (patch)
tree7c55a2447dc7175d8701c600e5536e4a18d8388b /tools
parentff806d034ef8e9a95ff0b0532104dd65332e446b (diff)
parente14505a8d50882ff3bdd4b791b14d90a0881fa4d (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next
Pull RCU changes from Ingo Molnar: "The main RCU changes in this cycle were: - RCU torture-test changes. - variable-name renaming cleanup. - update RCU documentation. - miscellaneous fixes. - patch to suppress RCU stall warnings while sysrq requests are being processed" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (68 commits) rcu: Provide API to suppress stall warnings while sysrc runs rcu: Variable name changed in tree_plugin.h and used in tree.c torture: Remove unused definition torture: Remove __init from torture_init_begin/end torture: Check for multiple concurrent torture tests locktorture: Remove reference to nonexistent Kconfig parameter rcutorture: Run rcu_torture_writer at normal priority rcutorture: Note diffs from git commits rcutorture: Add missing destroy_timer_on_stack() rcutorture: Explicitly test synchronous grace-period primitives rcutorture: Add tests for get_state_synchronize_rcu() rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels torture: Use elapsed time to detect hangs rcutorture: Check for rcu_torture_fqs creation errors torture: Better summary diagnostics for build failures torture: Notice if an all-zero cpumask is passed inside a critical section rcutorture: Make rcu_torture_reader() use cond_resched() sched,rcu: Make cond_resched() report RCU quiescent states percpu: Fix raw_cpu_inc_return() rcutorture: Export RCU grace-period kthread wait state to rcutorture ...
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/configinit.sh2
-rw-r--r--tools/testing/selftests/rcutorture/bin/functions.sh48
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-build.sh6
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh2
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh24
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh47
-rw-r--r--tools/testing/selftests/rcutorture/bin/kvm.sh142
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-torture.sh (renamed from tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh)22
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE02-T25
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot1
11 files changed, 200 insertions, 121 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
index a1be6e62add1..9c3f3d39b934 100755
--- a/tools/testing/selftests/rcutorture/bin/configinit.sh
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -62,7 +62,7 @@ grep '^grep' < $T/u.sh > $T/upd.sh
62echo "cat - $c" >> $T/upd.sh 62echo "cat - $c" >> $T/upd.sh
63make mrproper 63make mrproper
64make $buildloc distclean > $builddir/Make.distclean 2>&1 64make $buildloc distclean > $builddir/Make.distclean 2>&1
65make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1 65make $buildloc $TORTURE_DEFCONFIG > $builddir/Make.defconfig.out 2>&1
66mv $builddir/.config $builddir/.config.sav 66mv $builddir/.config $builddir/.config.sav
67sh $T/upd.sh < $builddir/.config.sav > $builddir/.config 67sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
68cp $builddir/.config $builddir/.config.new 68cp $builddir/.config $builddir/.config.new
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 9b17e810ddc3..d01b865bb100 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -76,15 +76,39 @@ configfrag_hotplug_cpu () {
76 grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1" 76 grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
77} 77}
78 78
79# identify_boot_image qemu-cmd
80#
81# Returns the relative path to the kernel build image. This will be
82# arch/<arch>/boot/bzImage unless overridden with the TORTURE_BOOT_IMAGE
83# environment variable.
84identify_boot_image () {
85 if test -n "$TORTURE_BOOT_IMAGE"
86 then
87 echo $TORTURE_BOOT_IMAGE
88 else
89 case "$1" in
90 qemu-system-x86_64|qemu-system-i386)
91 echo arch/x86/boot/bzImage
92 ;;
93 qemu-system-ppc64)
94 echo arch/powerpc/boot/bzImage
95 ;;
96 *)
97 echo ""
98 ;;
99 esac
100 fi
101}
102
79# identify_qemu builddir 103# identify_qemu builddir
80# 104#
81# Returns our best guess as to which qemu command is appropriate for 105# Returns our best guess as to which qemu command is appropriate for
82# the kernel at hand. Override with the RCU_QEMU_CMD environment variable. 106# the kernel at hand. Override with the TORTURE_QEMU_CMD environment variable.
83identify_qemu () { 107identify_qemu () {
84 local u="`file "$1"`" 108 local u="`file "$1"`"
85 if test -n "$RCU_QEMU_CMD" 109 if test -n "$TORTURE_QEMU_CMD"
86 then 110 then
87 echo $RCU_QEMU_CMD 111 echo $TORTURE_QEMU_CMD
88 elif echo $u | grep -q x86-64 112 elif echo $u | grep -q x86-64
89 then 113 then
90 echo qemu-system-x86_64 114 echo qemu-system-x86_64
@@ -98,7 +122,7 @@ identify_qemu () {
98 echo Cannot figure out what qemu command to use! 1>&2 122 echo Cannot figure out what qemu command to use! 1>&2
99 echo file $1 output: $u 123 echo file $1 output: $u
100 # Usually this will be one of /usr/bin/qemu-system-* 124 # Usually this will be one of /usr/bin/qemu-system-*
101 # Use RCU_QEMU_CMD environment variable or appropriate 125 # Use TORTURE_QEMU_CMD environment variable or appropriate
102 # argument to top-level script. 126 # argument to top-level script.
103 exit 1 127 exit 1
104 fi 128 fi
@@ -107,14 +131,14 @@ identify_qemu () {
107# identify_qemu_append qemu-cmd 131# identify_qemu_append qemu-cmd
108# 132#
109# Output arguments for the qemu "-append" string based on CPU type 133# Output arguments for the qemu "-append" string based on CPU type
110# and the RCU_QEMU_INTERACTIVE environment variable. 134# and the TORTURE_QEMU_INTERACTIVE environment variable.
111identify_qemu_append () { 135identify_qemu_append () {
112 case "$1" in 136 case "$1" in
113 qemu-system-x86_64|qemu-system-i386) 137 qemu-system-x86_64|qemu-system-i386)
114 echo noapic selinux=0 initcall_debug debug 138 echo noapic selinux=0 initcall_debug debug
115 ;; 139 ;;
116 esac 140 esac
117 if test -n "$RCU_QEMU_INTERACTIVE" 141 if test -n "$TORTURE_QEMU_INTERACTIVE"
118 then 142 then
119 echo root=/dev/sda 143 echo root=/dev/sda
120 else 144 else
@@ -124,8 +148,8 @@ identify_qemu_append () {
124 148
125# identify_qemu_args qemu-cmd serial-file 149# identify_qemu_args qemu-cmd serial-file
126# 150#
127# Output arguments for qemu arguments based on the RCU_QEMU_MAC 151# Output arguments for qemu arguments based on the TORTURE_QEMU_MAC
128# and RCU_QEMU_INTERACTIVE environment variables. 152# and TORTURE_QEMU_INTERACTIVE environment variables.
129identify_qemu_args () { 153identify_qemu_args () {
130 case "$1" in 154 case "$1" in
131 qemu-system-x86_64|qemu-system-i386) 155 qemu-system-x86_64|qemu-system-i386)
@@ -133,17 +157,17 @@ identify_qemu_args () {
133 qemu-system-ppc64) 157 qemu-system-ppc64)
134 echo -enable-kvm -M pseries -cpu POWER7 -nodefaults 158 echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
135 echo -device spapr-vscsi 159 echo -device spapr-vscsi
136 if test -n "$RCU_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC" 160 if test -n "$TORTURE_QEMU_INTERACTIVE" -a -n "$TORTURE_QEMU_MAC"
137 then 161 then
138 echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC 162 echo -device spapr-vlan,netdev=net0,mac=$TORTURE_QEMU_MAC
139 echo -netdev bridge,br=br0,id=net0 163 echo -netdev bridge,br=br0,id=net0
140 elif test -n "$RCU_QEMU_INTERACTIVE" 164 elif test -n "$TORTURE_QEMU_INTERACTIVE"
141 then 165 then
142 echo -net nic -net user 166 echo -net nic -net user
143 fi 167 fi
144 ;; 168 ;;
145 esac 169 esac
146 if test -n "$RCU_QEMU_INTERACTIVE" 170 if test -n "$TORTURE_QEMU_INTERACTIVE"
147 then 171 then
148 echo -monitor stdio -serial pty -S 172 echo -monitor stdio -serial pty -S
149 else 173 else
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 197901ec10bf..7c1e56b46de4 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -45,9 +45,9 @@ T=/tmp/test-linux.sh.$$
45trap 'rm -rf $T' 0 45trap 'rm -rf $T' 0
46mkdir $T 46mkdir $T
47 47
48cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config 48grep -v 'CONFIG_[A-Z]*_TORTURE_TEST' < ${config_template} > $T/config
49cat << ___EOF___ >> $T/config 49cat << ___EOF___ >> $T/config
50CONFIG_INITRAMFS_SOURCE="$RCU_INITRD" 50CONFIG_INITRAMFS_SOURCE="$TORTURE_INITRD"
51CONFIG_VIRTIO_PCI=y 51CONFIG_VIRTIO_PCI=y
52CONFIG_VIRTIO_CONSOLE=y 52CONFIG_VIRTIO_CONSOLE=y
53___EOF___ 53___EOF___
@@ -60,7 +60,7 @@ then
60 exit 2 60 exit 2
61fi 61fi
62ncpus=`cpus2use.sh` 62ncpus=`cpus2use.sh`
63make O=$builddir -j$ncpus $RCU_KMAKE_ARG > $builddir/Make.out 2>&1 63make O=$builddir -j$ncpus $TORTURE_KMAKE_ARG > $builddir/Make.out 2>&1
64retval=$? 64retval=$?
65if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out 65if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
66then 66then
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
index 829186e19eb1..7f1ff1a8fc4b 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-lock.sh
@@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
35ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'` 35ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
36if test -z "$ncs" 36if test -z "$ncs"
37then 37then
38 echo $configfile 38 echo "$configfile -------"
39else 39else
40 title="$configfile ------- $ncs acquisitions/releases" 40 title="$configfile ------- $ncs acquisitions/releases"
41 dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null` 41 dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index d75b1dc5ae53..307c4b95f325 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -35,7 +35,7 @@ configfile=`echo $i | sed -e 's/^.*\///'`
35ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'` 35ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
36if test -z "$ngps" 36if test -z "$ngps"
37then 37then
38 echo $configfile 38 echo "$configfile -------"
39else 39else
40 title="$configfile ------- $ngps grace periods" 40 title="$configfile ------- $ngps grace periods"
41 dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null` 41 dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index a44daaa259a9..ee1f6cae3d70 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -25,6 +25,7 @@
25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
26 26
27PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH 27PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
28. tools/testing/selftests/rcutorture/bin/functions.sh
28for rd in "$@" 29for rd in "$@"
29do 30do
30 firsttime=1 31 firsttime=1
@@ -39,13 +40,24 @@ do
39 fi 40 fi
40 TORTURE_SUITE="`cat $i/../TORTURE_SUITE`" 41 TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
41 kvm-recheck-${TORTURE_SUITE}.sh $i 42 kvm-recheck-${TORTURE_SUITE}.sh $i
42 configcheck.sh $i/.config $i/ConfigFragment 43 if test -f "$i/console.log"
43 parse-build.sh $i/Make.out $configfile
44 parse-rcutorture.sh $i/console.log $configfile
45 parse-console.sh $i/console.log $configfile
46 if test -r $i/Warnings
47 then 44 then
48 cat $i/Warnings 45 configcheck.sh $i/.config $i/ConfigFragment
46 parse-build.sh $i/Make.out $configfile
47 parse-torture.sh $i/console.log $configfile
48 parse-console.sh $i/console.log $configfile
49 if test -r $i/Warnings
50 then
51 cat $i/Warnings
52 fi
53 else
54 if test -f "$i/qemu-cmd"
55 then
56 print_bug qemu failed
57 else
58 print_bug Build failed
59 fi
60 echo " $i"
49 fi 61 fi
50 done 62 done
51done 63done
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
index 94b28bb37d36..27e544e29510 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh
@@ -94,9 +94,17 @@ fi
94# CONFIG_YENTA=n 94# CONFIG_YENTA=n
95if kvm-build.sh $config_template $builddir $T 95if kvm-build.sh $config_template $builddir $T
96then 96then
97 QEMU="`identify_qemu $builddir/vmlinux`"
98 BOOT_IMAGE="`identify_boot_image $QEMU`"
97 cp $builddir/Make*.out $resdir 99 cp $builddir/Make*.out $resdir
98 cp $builddir/.config $resdir 100 cp $builddir/.config $resdir
99 cp $builddir/arch/x86/boot/bzImage $resdir 101 if test -n "$BOOT_IMAGE"
102 then
103 cp $builddir/$BOOT_IMAGE $resdir
104 else
105 echo No identifiable boot image, not running KVM, see $resdir.
106 echo Do the torture scripts know about your architecture?
107 fi
100 parse-build.sh $resdir/Make.out $title 108 parse-build.sh $resdir/Make.out $title
101 if test -f $builddir.wait 109 if test -f $builddir.wait
102 then 110 then
@@ -104,6 +112,7 @@ then
104 fi 112 fi
105else 113else
106 cp $builddir/Make*.out $resdir 114 cp $builddir/Make*.out $resdir
115 cp $builddir/.config $resdir || :
107 echo Build failed, not running KVM, see $resdir. 116 echo Build failed, not running KVM, see $resdir.
108 if test -f $builddir.wait 117 if test -f $builddir.wait
109 then 118 then
@@ -124,9 +133,6 @@ cd $KVM
124kstarttime=`awk 'BEGIN { print systime() }' < /dev/null` 133kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
125echo ' ---' `date`: Starting kernel 134echo ' ---' `date`: Starting kernel
126 135
127# Determine the appropriate flavor of qemu command.
128QEMU="`identify_qemu $builddir/vmlinux`"
129
130# Generate -smp qemu argument. 136# Generate -smp qemu argument.
131qemu_args="-nographic $qemu_args" 137qemu_args="-nographic $qemu_args"
132cpu_count=`configNR_CPUS.sh $config_template` 138cpu_count=`configNR_CPUS.sh $config_template`
@@ -151,27 +157,38 @@ boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
151# Generate kernel-version-specific boot parameters 157# Generate kernel-version-specific boot parameters
152boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`" 158boot_args="`per_version_boot_params "$boot_args" $builddir/.config $seconds`"
153 159
154echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd 160echo $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
155if test -n "$RCU_BUILDONLY" 161if test -n "$TORTURE_BUILDONLY"
156then 162then
157 echo Build-only run specified, boot/test omitted. 163 echo Build-only run specified, boot/test omitted.
158 exit 0 164 exit 0
159fi 165fi
160$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args" & 166( $QEMU $qemu_args -m 512 -kernel $builddir/$BOOT_IMAGE -append "$qemu_append $boot_args"; echo $? > $resdir/qemu-retval ) &
161qemu_pid=$! 167qemu_pid=$!
162commandcompleted=0 168commandcompleted=0
163echo Monitoring qemu job at pid $qemu_pid 169echo Monitoring qemu job at pid $qemu_pid
164for ((i=0;i<$seconds;i++)) 170while :
165do 171do
172 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
166 if kill -0 $qemu_pid > /dev/null 2>&1 173 if kill -0 $qemu_pid > /dev/null 2>&1
167 then 174 then
175 if test $kruntime -ge $seconds
176 then
177 break;
178 fi
168 sleep 1 179 sleep 1
169 else 180 else
170 commandcompleted=1 181 commandcompleted=1
171 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
172 if test $kruntime -lt $seconds 182 if test $kruntime -lt $seconds
173 then 183 then
174 echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1 184 echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
185 grep "^(qemu) qemu:" $resdir/kvm-test-1-run.sh.out >> $resdir/Warnings 2>&1
186 killpid="`sed -n "s/^(qemu) qemu: terminating on signal [0-9]* from pid \([0-9]*\).*$/\1/p" $resdir/Warnings`"
187 if test -n "$killpid"
188 then
189 echo "ps -fp $killpid" >> $resdir/Warnings 2>&1
190 ps -fp $killpid >> $resdir/Warnings 2>&1
191 fi
175 else 192 else
176 echo ' ---' `date`: Kernel done 193 echo ' ---' `date`: Kernel done
177 fi 194 fi
@@ -181,23 +198,25 @@ done
181if test $commandcompleted -eq 0 198if test $commandcompleted -eq 0
182then 199then
183 echo Grace period for qemu job at pid $qemu_pid 200 echo Grace period for qemu job at pid $qemu_pid
184 for ((i=0;i<=$grace;i++)) 201 while :
185 do 202 do
203 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
186 if kill -0 $qemu_pid > /dev/null 2>&1 204 if kill -0 $qemu_pid > /dev/null 2>&1
187 then 205 then
188 sleep 1 206 :
189 else 207 else
190 break 208 break
191 fi 209 fi
192 if test $i -eq $grace 210 if test $kruntime -ge $((seconds + grace))
193 then 211 then
194 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }'`
195 echo "!!! Hang at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1 212 echo "!!! Hang at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1
196 kill -KILL $qemu_pid 213 kill -KILL $qemu_pid
214 break
197 fi 215 fi
216 sleep 1
198 done 217 done
199fi 218fi
200 219
201cp $builddir/console.log $resdir 220cp $builddir/console.log $resdir
202parse-${TORTURE_SUITE}torture.sh $resdir/console.log $title 221parse-torture.sh $resdir/console.log $title
203parse-console.sh $resdir/console.log $title 222parse-console.sh $resdir/console.log $title
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 5a78cbf55f06..40285c58653e 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -38,9 +38,10 @@ dur=30
38dryrun="" 38dryrun=""
39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM 39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
40PATH=${KVM}/bin:$PATH; export PATH 40PATH=${KVM}/bin:$PATH; export PATH
41builddir="${KVM}/b1" 41TORTURE_DEFCONFIG=defconfig
42RCU_INITRD="$KVM/initrd"; export RCU_INITRD 42TORTURE_BOOT_IMAGE=""
43RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG 43TORTURE_INITRD="$KVM/initrd"; export TORTURE_INITRD
44TORTURE_KMAKE_ARG=""
44TORTURE_SUITE=rcu 45TORTURE_SUITE=rcu
45resdir="" 46resdir=""
46configs="" 47configs=""
@@ -53,11 +54,12 @@ kversion=""
53usage () { 54usage () {
54 echo "Usage: $scriptname optional arguments:" 55 echo "Usage: $scriptname optional arguments:"
55 echo " --bootargs kernel-boot-arguments" 56 echo " --bootargs kernel-boot-arguments"
56 echo " --builddir absolute-pathname" 57 echo " --bootimage relative-path-to-kernel-boot-image"
57 echo " --buildonly" 58 echo " --buildonly"
58 echo " --configs \"config-file list\"" 59 echo " --configs \"config-file list\""
59 echo " --cpus N" 60 echo " --cpus N"
60 echo " --datestamp string" 61 echo " --datestamp string"
62 echo " --defconfig string"
61 echo " --dryrun sched|script" 63 echo " --dryrun sched|script"
62 echo " --duration minutes" 64 echo " --duration minutes"
63 echo " --interactive" 65 echo " --interactive"
@@ -67,7 +69,6 @@ usage () {
67 echo " --no-initrd" 69 echo " --no-initrd"
68 echo " --qemu-args qemu-system-..." 70 echo " --qemu-args qemu-system-..."
69 echo " --qemu-cmd qemu-system-..." 71 echo " --qemu-cmd qemu-system-..."
70 echo " --relbuilddir relative-pathname"
71 echo " --results absolute-pathname" 72 echo " --results absolute-pathname"
72 echo " --torture rcu" 73 echo " --torture rcu"
73 exit 1 74 exit 1
@@ -78,17 +79,16 @@ do
78 case "$1" in 79 case "$1" in
79 --bootargs) 80 --bootargs)
80 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--' 81 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
81 RCU_BOOTARGS="$2" 82 TORTURE_BOOTARGS="$2"
82 shift 83 shift
83 ;; 84 ;;
84 --builddir) 85 --bootimage)
85 checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' '^error' 86 checkarg --bootimage "(relative path to kernel boot image)" "$#" "$2" '[a-zA-Z0-9][a-zA-Z0-9_]*' '^--'
86 builddir=$2 87 TORTURE_BOOT_IMAGE="$2"
87 gotbuilddir=1
88 shift 88 shift
89 ;; 89 ;;
90 --buildonly) 90 --buildonly)
91 RCU_BUILDONLY=1; export RCU_BUILDONLY 91 TORTURE_BUILDONLY=1
92 ;; 92 ;;
93 --configs) 93 --configs)
94 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--' 94 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
@@ -105,6 +105,11 @@ do
105 ds=$2 105 ds=$2
106 shift 106 shift
107 ;; 107 ;;
108 --defconfig)
109 checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
110 TORTURE_DEFCONFIG=$2
111 shift
112 ;;
108 --dryrun) 113 --dryrun)
109 checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--' 114 checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
110 dryrun=$2 115 dryrun=$2
@@ -116,11 +121,11 @@ do
116 shift 121 shift
117 ;; 122 ;;
118 --interactive) 123 --interactive)
119 RCU_QEMU_INTERACTIVE=1; export RCU_QEMU_INTERACTIVE 124 TORTURE_QEMU_INTERACTIVE=1; export TORTURE_QEMU_INTERACTIVE
120 ;; 125 ;;
121 --kmake-arg) 126 --kmake-arg)
122 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$' 127 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
123 RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG 128 TORTURE_KMAKE_ARG="$2"
124 shift 129 shift
125 ;; 130 ;;
126 --kversion) 131 --kversion)
@@ -130,27 +135,20 @@ do
130 ;; 135 ;;
131 --mac) 136 --mac)
132 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error 137 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
133 RCU_QEMU_MAC=$2; export RCU_QEMU_MAC 138 TORTURE_QEMU_MAC=$2
134 shift 139 shift
135 ;; 140 ;;
136 --no-initrd) 141 --no-initrd)
137 RCU_INITRD=""; export RCU_INITRD 142 TORTURE_INITRD=""; export TORTURE_INITRD
138 ;; 143 ;;
139 --qemu-args) 144 --qemu-args)
140 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error' 145 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
141 RCU_QEMU_ARG="$2" 146 TORTURE_QEMU_ARG="$2"
142 shift 147 shift
143 ;; 148 ;;
144 --qemu-cmd) 149 --qemu-cmd)
145 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--' 150 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
146 RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD 151 TORTURE_QEMU_CMD="$2"
147 shift
148 ;;
149 --relbuilddir)
150 checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
151 relbuilddir=$2
152 gotrelbuilddir=1
153 builddir=${KVM}/${relbuilddir}
154 shift 152 shift
155 ;; 153 ;;
156 --results) 154 --results)
@@ -184,30 +182,6 @@ then
184 resdir=$KVM/res 182 resdir=$KVM/res
185fi 183fi
186 184
187if test "$dryrun" = ""
188then
189 if ! test -e $resdir
190 then
191 mkdir -p "$resdir" || :
192 fi
193 mkdir $resdir/$ds
194
195 # Be noisy only if running the script.
196 echo Results directory: $resdir/$ds
197 echo $scriptname $args
198
199 touch $resdir/$ds/log
200 echo $scriptname $args >> $resdir/$ds/log
201 echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE
202
203 pwd > $resdir/$ds/testid.txt
204 if test -d .git
205 then
206 git status >> $resdir/$ds/testid.txt
207 git rev-parse HEAD >> $resdir/$ds/testid.txt
208 fi
209fi
210
211# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus. 185# Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
212touch $T/cfgcpu 186touch $T/cfgcpu
213for CF in $configs 187for CF in $configs
@@ -274,7 +248,39 @@ END {
274 248
275# Generate a script to execute the tests in appropriate batches. 249# Generate a script to execute the tests in appropriate batches.
276cat << ___EOF___ > $T/script 250cat << ___EOF___ > $T/script
251CONFIGFRAG="$CONFIGFRAG"; export CONFIGFRAG
252KVM="$KVM"; export KVM
253KVPATH="$KVPATH"; export KVPATH
254PATH="$PATH"; export PATH
255TORTURE_BOOT_IMAGE="$TORTURE_BOOT_IMAGE"; export TORTURE_BOOT_IMAGE
256TORTURE_BUILDONLY="$TORTURE_BUILDONLY"; export TORTURE_BUILDONLY
257TORTURE_DEFCONFIG="$TORTURE_DEFCONFIG"; export TORTURE_DEFCONFIG
258TORTURE_INITRD="$TORTURE_INITRD"; export TORTURE_INITRD
259TORTURE_KMAKE_ARG="$TORTURE_KMAKE_ARG"; export TORTURE_KMAKE_ARG
260TORTURE_QEMU_CMD="$TORTURE_QEMU_CMD"; export TORTURE_QEMU_CMD
261TORTURE_QEMU_INTERACTIVE="$TORTURE_QEMU_INTERACTIVE"; export TORTURE_QEMU_INTERACTIVE
262TORTURE_QEMU_MAC="$TORTURE_QEMU_MAC"; export TORTURE_QEMU_MAC
277TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE 263TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
264if ! test -e $resdir
265then
266 mkdir -p "$resdir" || :
267fi
268mkdir $resdir/$ds
269echo Results directory: $resdir/$ds
270echo $scriptname $args
271touch $resdir/$ds/log
272echo $scriptname $args >> $resdir/$ds/log
273echo ${TORTURE_SUITE} > $resdir/$ds/TORTURE_SUITE
274pwd > $resdir/$ds/testid.txt
275if test -d .git
276then
277 git status >> $resdir/$ds/testid.txt
278 git rev-parse HEAD >> $resdir/$ds/testid.txt
279 if ! git diff HEAD > $T/git-diff 2>&1
280 then
281 cp $T/git-diff $resdir/$ds
282 fi
283fi
278___EOF___ 284___EOF___
279awk < $T/cfgcpu.pack \ 285awk < $T/cfgcpu.pack \
280 -v CONFIGDIR="$CONFIGFRAG/$kversion/" \ 286 -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
@@ -282,8 +288,8 @@ awk < $T/cfgcpu.pack \
282 -v ncpus=$cpus \ 288 -v ncpus=$cpus \
283 -v rd=$resdir/$ds/ \ 289 -v rd=$resdir/$ds/ \
284 -v dur=$dur \ 290 -v dur=$dur \
285 -v RCU_QEMU_ARG=$RCU_QEMU_ARG \ 291 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
286 -v RCU_BOOTARGS=$RCU_BOOTARGS \ 292 -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \
287'BEGIN { 293'BEGIN {
288 i = 0; 294 i = 0;
289} 295}
@@ -320,7 +326,7 @@ function dump(first, pastlast)
320 print "touch " builddir ".wait"; 326 print "touch " builddir ".wait";
321 print "mkdir " builddir " > /dev/null 2>&1 || :"; 327 print "mkdir " builddir " > /dev/null 2>&1 || :";
322 print "mkdir " rd cfr[jn] " || :"; 328 print "mkdir " rd cfr[jn] " || :";
323 print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" RCU_QEMU_ARG "\" \"" RCU_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &" 329 print "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE_BOOTARGS "\" > " rd cfr[jn] "/kvm-test-1-run.sh.out 2>&1 &"
324 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`"; 330 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date`";
325 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log"; 331 print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` >> " rd "/log";
326 print "while test -f " builddir ".wait" 332 print "while test -f " builddir ".wait"
@@ -374,28 +380,26 @@ END {
374 dump(first, i); 380 dump(first, i);
375}' >> $T/script 381}' >> $T/script
376 382
383cat << ___EOF___ >> $T/script
384echo
385echo
386echo " --- `date` Test summary:"
387echo Results directory: $resdir/$ds
388if test -z "$TORTURE_BUILDONLY"
389then
390 kvm-recheck.sh $resdir/$ds
391fi
392___EOF___
393
377if test "$dryrun" = script 394if test "$dryrun" = script
378then 395then
379 # Dump out the script, but define the environment variables that
380 # it needs to run standalone.
381 echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
382 echo KVM="$KVM; export KVM"
383 echo KVPATH="$KVPATH; export KVPATH"
384 echo PATH="$PATH; export PATH"
385 echo RCU_BUILDONLY="$RCU_BUILDONLY; export RCU_BUILDONLY"
386 echo RCU_INITRD="$RCU_INITRD; export RCU_INITRD"
387 echo RCU_KMAKE_ARG="$RCU_KMAKE_ARG; export RCU_KMAKE_ARG"
388 echo RCU_QEMU_CMD="$RCU_QEMU_CMD; export RCU_QEMU_CMD"
389 echo RCU_QEMU_INTERACTIVE="$RCU_QEMU_INTERACTIVE; export RCU_QEMU_INTERACTIVE"
390 echo RCU_QEMU_MAC="$RCU_QEMU_MAC; export RCU_QEMU_MAC"
391 echo "mkdir -p "$resdir" || :"
392 echo "mkdir $resdir/$ds"
393 cat $T/script 396 cat $T/script
394 exit 0 397 exit 0
395elif test "$dryrun" = sched 398elif test "$dryrun" = sched
396then 399then
397 # Extract the test run schedule from the script. 400 # Extract the test run schedule from the script.
398 egrep 'start batch|Starting build\.' $T/script | 401 egrep 'Start batch|Starting build\.' $T/script |
402 grep -v ">>" |
399 sed -e 's/:.*$//' -e 's/^echo //' 403 sed -e 's/:.*$//' -e 's/^echo //'
400 exit 0 404 exit 0
401else 405else
@@ -404,9 +408,3 @@ else
404fi 408fi
405 409
406# Tracing: trace_event=rcu:rcu_grace_period,rcu:rcu_future_grace_period,rcu:rcu_grace_period_init,rcu:rcu_nocb_wake,rcu:rcu_preempt_task,rcu:rcu_unlock_preempted_task,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_kfree_callback,rcu:rcu_batch_start,rcu:rcu_invoke_callback,rcu:rcu_invoke_kfree_callback,rcu:rcu_batch_end,rcu:rcu_torture_read,rcu:rcu_barrier 410# Tracing: trace_event=rcu:rcu_grace_period,rcu:rcu_future_grace_period,rcu:rcu_grace_period_init,rcu:rcu_nocb_wake,rcu:rcu_preempt_task,rcu:rcu_unlock_preempted_task,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_kfree_callback,rcu:rcu_batch_start,rcu:rcu_invoke_callback,rcu:rcu_invoke_kfree_callback,rcu:rcu_batch_end,rcu:rcu_torture_read,rcu:rcu_barrier
407
408echo
409echo
410echo " --- `date` Test summary:"
411echo Results directory: $resdir/$ds
412kvm-recheck.sh $resdir/$ds
diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
index dd0a275d9796..3455560ab4e4 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
+++ b/tools/testing/selftests/rcutorture/bin/parse-torture.sh
@@ -1,14 +1,14 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# Check the console output from an rcutorture run for goodness. 3# Check the console output from a torture run for goodness.
4# The "file" is a pathname on the local system, and "title" is 4# The "file" is a pathname on the local system, and "title" is
5# a text string for error-message purposes. 5# a text string for error-message purposes.
6# 6#
7# The file must contain rcutorture output, but can be interspersed 7# The file must contain torture output, but can be interspersed
8# with other dmesg text. 8# with other dmesg text, as in console-log output.
9# 9#
10# Usage: 10# Usage:
11# sh parse-rcutorture.sh file title 11# sh parse-torture.sh file title
12# 12#
13# This program is free software; you can redistribute it and/or modify 13# This program is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by 14# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
28# 28#
29# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 29# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
30 30
31T=/tmp/parse-rcutorture.sh.$$ 31T=/tmp/parse-torture.sh.$$
32file="$1" 32file="$1"
33title="$2" 33title="$2"
34 34
@@ -36,13 +36,13 @@ trap 'rm -f $T.seq' 0
36 36
37. functions.sh 37. functions.sh
38 38
39# check for presence of rcutorture.txt file 39# check for presence of torture output file.
40 40
41if test -f "$file" -a -r "$file" 41if test -f "$file" -a -r "$file"
42then 42then
43 : 43 :
44else 44else
45 echo $title unreadable rcutorture.txt file: $file 45 echo $title unreadable torture output file: $file
46 exit 1 46 exit 1
47fi 47fi
48 48
@@ -76,9 +76,9 @@ BEGIN {
76END { 76END {
77 if (badseq) { 77 if (badseq) {
78 if (badseqno1 == badseqno2 && badseqno2 == ver) 78 if (badseqno1 == badseqno2 && badseqno2 == ver)
79 print "RCU GP HANG at " ver " rcutorture stat " badseqnr; 79 print "GP HANG at " ver " torture stat " badseqnr;
80 else 80 else
81 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr; 81 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " version " badseqnr;
82 } 82 }
83 }' > $T.seq 83 }' > $T.seq
84 84
@@ -91,13 +91,13 @@ then
91 exit 2 91 exit 2
92 fi 92 fi
93else 93else
94 if grep -q RCU_HOTPLUG $file 94 if grep -q "_HOTPLUG:" $file
95 then 95 then
96 print_warning HOTPLUG FAILURES $title `cat $T.seq` 96 print_warning HOTPLUG FAILURES $title `cat $T.seq`
97 echo " " $file 97 echo " " $file
98 exit 3 98 exit 3
99 fi 99 fi
100 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages 100 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful version messages
101 if test -s $T.seq 101 if test -s $T.seq
102 then 102 then
103 print_warning $title `cat $T.seq` 103 print_warning $title `cat $T.seq`
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T b/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T
new file mode 100644
index 000000000000..61c8d9ce5bb2
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE02-T
@@ -0,0 +1,25 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=y
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=3
16CONFIG_RCU_FANOUT_LEAF=3
17CONFIG_RCU_FANOUT_EXACT=n
18CONFIG_RCU_NOCB_CPU=n
19CONFIG_DEBUG_LOCK_ALLOC=y
20CONFIG_PROVE_LOCKING=n
21CONFIG_PROVE_RCU_DELAY=n
22CONFIG_RCU_CPU_STALL_INFO=n
23CONFIG_RCU_CPU_STALL_VERBOSE=y
24CONFIG_RCU_BOOST=n
25CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
new file mode 100644
index 000000000000..3b42b8b033cd
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
@@ -0,0 +1 @@
rcutorture.torture_type=sched