diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-09-28 17:12:21 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-12-03 13:11:10 -0500 |
commit | c87b9c601ac862b1fa41a9d759a3c05711a8391d (patch) | |
tree | 748bd3703dbf5d00fdd4009a3b49d61d8d157a83 /tools/testing | |
parent | dc1ccc48159d63eca5089e507c82c7d22ef60839 (diff) |
rcutorture: Add KVM-based test framework
This commit adds the test framework that I used to test RCU under KVM.
This consists of a group of scripts and Kconfig fragments.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
40 files changed, 1650 insertions, 0 deletions
diff --git a/tools/testing/selftests/rcutorture/.gitignore b/tools/testing/selftests/rcutorture/.gitignore new file mode 100644 index 000000000000..05838f6f2ebe --- /dev/null +++ b/tools/testing/selftests/rcutorture/.gitignore | |||
@@ -0,0 +1,6 @@ | |||
1 | initrd | ||
2 | linux-2.6 | ||
3 | b[0-9]* | ||
4 | rcu-test-image | ||
5 | res | ||
6 | *.swp | ||
diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh b/tools/testing/selftests/rcutorture/bin/config2frag.sh new file mode 100644 index 000000000000..252f769c17ba --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/bin/sh | ||
2 | # Usage: sh config2frag.sh < .config > configfrag | ||
3 | # | ||
4 | # Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the | ||
5 | # resulting file becomes a legitimate Kconfig fragment. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License as published by | ||
9 | # the Free Software Foundation; either version 2 of the License, or | ||
10 | # (at your option) any later version. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License | ||
18 | # along with this program; if not, write to the Free Software | ||
19 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
20 | # | ||
21 | # Copyright (C) IBM Corporation, 2013 | ||
22 | # | ||
23 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
24 | |||
25 | LANG=C sed -e 's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/' | ||
diff --git a/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh new file mode 100755 index 000000000000..9e8b11206dcc --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh | |||
@@ -0,0 +1,45 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Extract the number of CPUs expected from the specified Kconfig-file | ||
4 | # fragment by checking CONFIG_SMP and CONFIG_NR_CPUS. If the specified | ||
5 | # file gives no clue, base the number on the number of idle CPUs on | ||
6 | # the system. | ||
7 | # | ||
8 | # Usage: configNR_CPUS.sh config-frag | ||
9 | # | ||
10 | # This program is free software; you can redistribute it and/or modify | ||
11 | # it under the terms of the GNU General Public License as published by | ||
12 | # the Free Software Foundation; either version 2 of the License, or | ||
13 | # (at your option) any later version. | ||
14 | # | ||
15 | # This program is distributed in the hope that it will be useful, | ||
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | # GNU General Public License for more details. | ||
19 | # | ||
20 | # You should have received a copy of the GNU General Public License | ||
21 | # along with this program; if not, write to the Free Software | ||
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
23 | # | ||
24 | # Copyright (C) IBM Corporation, 2013 | ||
25 | # | ||
26 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
27 | |||
28 | cf=$1 | ||
29 | if test ! -r $cf | ||
30 | then | ||
31 | echo Unreadable config fragment $cf 1>&2 | ||
32 | exit -1 | ||
33 | fi | ||
34 | if grep -q '^CONFIG_SMP=n$' $cf | ||
35 | then | ||
36 | echo 1 | ||
37 | exit 0 | ||
38 | fi | ||
39 | if grep -q '^CONFIG_NR_CPUS=' $cf | ||
40 | then | ||
41 | grep '^CONFIG_NR_CPUS=' $cf | | ||
42 | sed -e 's/^CONFIG_NR_CPUS=\([0-9]*\).*$/\1/' | ||
43 | exit 0 | ||
44 | fi | ||
45 | cpus2use.sh | ||
diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh b/tools/testing/selftests/rcutorture/bin/configcheck.sh new file mode 100755 index 000000000000..a3e5b9272b46 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | # Usage: sh configcheck.sh .config .config-template | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published by | ||
6 | # the Free Software Foundation; either version 2 of the License, or | ||
7 | # (at your option) any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with this program; if not, write to the Free Software | ||
16 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | # | ||
18 | # Copyright (C) IBM Corporation, 2011 | ||
19 | # | ||
20 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
21 | |||
22 | T=/tmp/abat-chk-config.sh.$$ | ||
23 | trap 'rm -rf $T' 0 | ||
24 | mkdir $T | ||
25 | |||
26 | cat $1 > $T/.config | ||
27 | |||
28 | cat $2 | sed -e 's/\(.*\)=n/# \1 is not set/' -e 's/^#CHECK#//' | | ||
29 | awk ' | ||
30 | BEGIN { | ||
31 | print "if grep -q \"" $0 "\" < '"$T/.config"'"; | ||
32 | print "then"; | ||
33 | print "\t:"; | ||
34 | print "else"; | ||
35 | if ($1 == "#") { | ||
36 | print "\tif grep -q \"" $2 "\" < '"$T/.config"'"; | ||
37 | print "\tthen"; | ||
38 | print "\t\tif test \"$firsttime\" = \"\"" | ||
39 | print "\t\tthen" | ||
40 | print "\t\t\tfirsttime=1" | ||
41 | print "\t\tfi" | ||
42 | print "\t\techo \":" $2 ": improperly set\""; | ||
43 | print "\telse"; | ||
44 | print "\t\t:"; | ||
45 | print "\tfi"; | ||
46 | } else { | ||
47 | print "\tif test \"$firsttime\" = \"\"" | ||
48 | print "\tthen" | ||
49 | print "\t\tfirsttime=1" | ||
50 | print "\tfi" | ||
51 | print "\techo \":" $0 ": improperly set\""; | ||
52 | } | ||
53 | print "fi"; | ||
54 | }' | sh | ||
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh new file mode 100755 index 000000000000..1f09d599e9d9 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/configinit.sh | |||
@@ -0,0 +1,83 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # sh configinit.sh config-spec-file [ build output dir ] | ||
4 | # | ||
5 | # Create a .config file from the spec file. Run from the kernel source tree. | ||
6 | # Exits with 0 if all went well, with 1 if all went well but the config | ||
7 | # did not match, and some other number for other failures. | ||
8 | # | ||
9 | # The first argument is the .config specification file, which contains | ||
10 | # desired settings, for example, "CONFIG_NO_HZ=y". For best results, | ||
11 | # this should be a full pathname. | ||
12 | # | ||
13 | # The second argument is a optional path to a build output directory, | ||
14 | # for example, "O=/tmp/foo". If this argument is omitted, the .config | ||
15 | # file will be generated directly in the current directory. | ||
16 | |||
17 | echo configinit.sh $* | ||
18 | |||
19 | T=/tmp/configinit.sh.$$ | ||
20 | trap 'rm -rf $T' 0 | ||
21 | mkdir $T | ||
22 | |||
23 | # Capture config spec file. | ||
24 | |||
25 | c=$1 | ||
26 | buildloc=$2 | ||
27 | builddir= | ||
28 | if test -n $buildloc | ||
29 | then | ||
30 | if echo $buildloc | grep -q '^O=' | ||
31 | then | ||
32 | builddir=`echo $buildloc | sed -e 's/^O=//'` | ||
33 | if test ! -d $builddir | ||
34 | then | ||
35 | mkdir $builddir | ||
36 | fi | ||
37 | else | ||
38 | echo Bad build directory: \"$builddir\" | ||
39 | exit 2 | ||
40 | fi | ||
41 | fi | ||
42 | |||
43 | sed -e 's/^\(CONFIG[0-9A-Z_]*\)=.*$/grep -v "^# \1" |/' < $c > $T/u.sh | ||
44 | sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh | ||
45 | grep '^grep' < $T/u.sh > $T/upd.sh | ||
46 | echo "cat - $c" >> $T/upd.sh | ||
47 | make mrproper | ||
48 | make $buildloc distclean > $builddir/Make.distclean 2>&1 | ||
49 | make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1 | ||
50 | mv $builddir/.config $builddir/.config.sav | ||
51 | sh $T/upd.sh < $builddir/.config.sav > $builddir/.config | ||
52 | cp $builddir/.config $builddir/.config.new | ||
53 | yes '' | make $buildloc oldconfig > $builddir/Make.modconfig.out 2>&1 | ||
54 | |||
55 | # verify new config matches specification. | ||
56 | |||
57 | sed -e 's/"//g' < $c > $T/c | ||
58 | sed -e 's/"//g' < $builddir/.config > $T/.config | ||
59 | sed -e 's/\(.*\)=n/# \1 is not set/' -e 's/^#CHECK#//' < $c | | ||
60 | awk ' | ||
61 | { | ||
62 | print "if grep -q \"" $0 "\" < '"$T/.config"'"; | ||
63 | print "then"; | ||
64 | print "\t:"; | ||
65 | print "else"; | ||
66 | if ($1 == "#") { | ||
67 | print "\tif grep -q \"" $2 "\" < '"$T/.config"'"; | ||
68 | print "\tthen"; | ||
69 | print "\t\techo \":" $2 ": improperly set\""; | ||
70 | print "\telse"; | ||
71 | print "\t\t:"; | ||
72 | print "\tfi"; | ||
73 | } else { | ||
74 | print "\techo \":" $0 ": improperly set\""; | ||
75 | } | ||
76 | print "fi"; | ||
77 | }' | sh > $T/diagnostics | ||
78 | if test -s $T/diagnostics | ||
79 | then | ||
80 | cat $T/diagnostics | ||
81 | exit 1 | ||
82 | fi | ||
83 | exit 0 | ||
diff --git a/tools/testing/selftests/rcutorture/bin/cpus2use.sh b/tools/testing/selftests/rcutorture/bin/cpus2use.sh new file mode 100755 index 000000000000..277a3f6c8210 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/cpus2use.sh | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Get an estimate of how CPU-hoggy to be. | ||
4 | # | ||
5 | # Usage: cpus2use.sh | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License as published by | ||
9 | # the Free Software Foundation; either version 2 of the License, or | ||
10 | # (at your option) any later version. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License | ||
18 | # along with this program; if not, write to the Free Software | ||
19 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
20 | # | ||
21 | # Copyright (C) IBM Corporation, 2013 | ||
22 | # | ||
23 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
24 | |||
25 | ncpus=`grep '^processor' /proc/cpuinfo | wc -l` | ||
26 | idlecpus=`mpstat | tail -1 | \ | ||
27 | awk -v ncpus=$ncpus '{ print ncpus * ($7 + $12) / 100 }'` | ||
28 | awk -v ncpus=$ncpus -v idlecpus=$idlecpus < /dev/null ' | ||
29 | BEGIN { | ||
30 | cpus2use = idlecpus; | ||
31 | if (cpus2use < 1) | ||
32 | cpus2use = 1; | ||
33 | if (cpus2use < ncpus / 10) | ||
34 | cpus2use = ncpus / 10; | ||
35 | if (cpus2use == int(cpus2use)) | ||
36 | cpus2use = int(cpus2use) | ||
37 | else | ||
38 | cpus2use = int(cpus2use) + 1 | ||
39 | print cpus2use; | ||
40 | }' | ||
41 | |||
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh new file mode 100644 index 000000000000..db1c32acdcf6 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/functions.sh | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # 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 | # bootparam_hotplug_cpu bootparam-string | ||
24 | # | ||
25 | # Returns 1 if the specified boot-parameter string tells rcutorture to | ||
26 | # test CPU-hotplug operations. | ||
27 | bootparam_hotplug_cpu () { | ||
28 | echo "$1" | grep -q "rcutorture\.onoff_" | ||
29 | } | ||
30 | |||
31 | # configfrag_hotplug_cpu config-fragment-file | ||
32 | # | ||
33 | # Returns 1 if the config fragment specifies hotplug CPU. | ||
34 | configfrag_hotplug_cpu () { | ||
35 | cf=$1 | ||
36 | if test ! -r $cf | ||
37 | then | ||
38 | echo Unreadable config fragment $cf 1>&2 | ||
39 | exit -1 | ||
40 | fi | ||
41 | grep -q '^CONFIG_HOTPLUG_CPU=y$' $cf | ||
42 | } | ||
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh new file mode 100755 index 000000000000..07bbeccb5a28 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh | |||
@@ -0,0 +1,71 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Build a kvm-ready Linux kernel from the tree in the current directory. | ||
4 | # | ||
5 | # Usage: sh kvm-build.sh config-template build-dir more-configs | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License as published by | ||
9 | # the Free Software Foundation; either version 2 of the License, or | ||
10 | # (at your option) any later version. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU General Public License | ||
18 | # along with this program; if not, write to the Free Software | ||
19 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
20 | # | ||
21 | # Copyright (C) IBM Corporation, 2011 | ||
22 | # | ||
23 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
24 | |||
25 | config_template=${1} | ||
26 | if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template" | ||
27 | then | ||
28 | echo "kvm-build.sh :$config_template: Not a readable file" | ||
29 | exit 1 | ||
30 | fi | ||
31 | builddir=${2} | ||
32 | if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir" | ||
33 | then | ||
34 | echo "kvm-build.sh :$builddir: Not a writable directory, cannot build into it" | ||
35 | exit 1 | ||
36 | fi | ||
37 | moreconfigs=${3} | ||
38 | if test -z "$moreconfigs" -o ! -r "$moreconfigs" | ||
39 | then | ||
40 | echo "kvm-build.sh :$moreconfigs: Not a readable file" | ||
41 | exit 1 | ||
42 | fi | ||
43 | |||
44 | T=/tmp/test-linux.sh.$$ | ||
45 | trap 'rm -rf $T' 0 | ||
46 | mkdir $T | ||
47 | |||
48 | cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config | ||
49 | cat << ___EOF___ >> $T/config | ||
50 | CONFIG_INITRAMFS_SOURCE="$KVM/initrd" | ||
51 | CONFIG_VIRTIO_PCI=y | ||
52 | CONFIG_VIRTIO_CONSOLE=y | ||
53 | ___EOF___ | ||
54 | cat $moreconfigs >> $T/config | ||
55 | |||
56 | configinit.sh $T/config O=$builddir | ||
57 | retval=$? | ||
58 | if test $retval -gt 1 | ||
59 | then | ||
60 | exit 2 | ||
61 | fi | ||
62 | ncpus=`cpus2use.sh` | ||
63 | make O=$builddir -j$ncpus > $builddir/Make.out 2>&1 | ||
64 | retval=$? | ||
65 | if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out | ||
66 | then | ||
67 | echo Kernel build error | ||
68 | egrep "Stop|Error|error:|warning:" < $builddir/Make.out | ||
69 | echo Run aborted. | ||
70 | exit 3 | ||
71 | fi | ||
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh new file mode 100755 index 000000000000..0876af75b66b --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Given the results directories for previous KVM runs of rcutorture, | ||
4 | # check the build and console output for errors. Given a directory | ||
5 | # containing results directories, this recursively checks them all. | ||
6 | # | ||
7 | # Usage: sh kvm-recheck.sh configdir resdir ... | ||
8 | # | ||
9 | # This program is free software; you can redistribute it and/or modify | ||
10 | # it under the terms of the GNU General Public License as published by | ||
11 | # the Free Software Foundation; either version 2 of the License, or | ||
12 | # (at your option) any later version. | ||
13 | # | ||
14 | # This program is distributed in the hope that it will be useful, | ||
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | # GNU General Public License for more details. | ||
18 | # | ||
19 | # You should have received a copy of the GNU General Public License | ||
20 | # along with this program; if not, write to the Free Software | ||
21 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | # | ||
23 | # Copyright (C) IBM Corporation, 2011 | ||
24 | # | ||
25 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
26 | |||
27 | PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH | ||
28 | configdir=${1} | ||
29 | shift | ||
30 | for rd in "$@" | ||
31 | do | ||
32 | dirs=`find $rd -name Make.defconfig.out -print | sort | sed -e 's,/[^/]*$,,' | sort -u` | ||
33 | for i in $dirs | ||
34 | do | ||
35 | configfile=`echo $i | sed -e 's/^.*\///'` | ||
36 | echo $i | ||
37 | configcheck.sh $i/.config $configdir/$configfile | ||
38 | parse-build.sh $i/Make.out $configfile | ||
39 | parse-rcutorture.sh $i/console.log $configfile | ||
40 | parse-console.sh $i/console.log $configfile | ||
41 | if test -r $i/Warnings | ||
42 | then | ||
43 | cat $i/Warnings | ||
44 | fi | ||
45 | done | ||
46 | done | ||
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh new file mode 100755 index 000000000000..ae5c2ff4c0ce --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | |||
@@ -0,0 +1,189 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Run a kvm-based test of the specified tree on the specified configs. | ||
4 | # Fully automated run and error checking, no graphics console. | ||
5 | # | ||
6 | # Execute this in the source tree. Do not run it as a background task | ||
7 | # because qemu does not seem to like that much. | ||
8 | # | ||
9 | # Usage: sh kvm-test-1-rcu.sh config builddir resdir minutes qemu-args bootargs | ||
10 | # | ||
11 | # qemu-args defaults to "" -- you will want "-nographic" if running headless. | ||
12 | # bootargs defaults to "root=/dev/sda noapic selinux=0 console=ttyS0" | ||
13 | # "initcall_debug debug rcutorture.stat_interval=15" | ||
14 | # "rcutorture.shutdown_secs=$((minutes * 60))" | ||
15 | # "rcutorture.rcutorture_runnable=1" | ||
16 | # | ||
17 | # Anything you specify for either qemu-args or bootargs is appended to | ||
18 | # the default values. The "-smp" value is deduced from the contents of | ||
19 | # the config fragment. | ||
20 | # | ||
21 | # More sophisticated argument parsing is clearly needed. | ||
22 | # | ||
23 | # This program is free software; you can redistribute it and/or modify | ||
24 | # it under the terms of the GNU General Public License as published by | ||
25 | # the Free Software Foundation; either version 2 of the License, or | ||
26 | # (at your option) any later version. | ||
27 | # | ||
28 | # This program is distributed in the hope that it will be useful, | ||
29 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
30 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
31 | # GNU General Public License for more details. | ||
32 | # | ||
33 | # You should have received a copy of the GNU General Public License | ||
34 | # along with this program; if not, write to the Free Software | ||
35 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
36 | # | ||
37 | # Copyright (C) IBM Corporation, 2011 | ||
38 | # | ||
39 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
40 | |||
41 | grace=120 | ||
42 | |||
43 | T=/tmp/kvm-test-1-rcu.sh.$$ | ||
44 | trap 'rm -rf $T' 0 | ||
45 | |||
46 | . $KVM/bin/functions.sh | ||
47 | |||
48 | config_template=${1} | ||
49 | title=`echo $config_template | sed -e 's/^.*\///'` | ||
50 | builddir=${2} | ||
51 | if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir" | ||
52 | then | ||
53 | echo "kvm-test-1-rcu.sh :$builddir: Not a writable directory, cannot build into it" | ||
54 | exit 1 | ||
55 | fi | ||
56 | resdir=${3} | ||
57 | if test -z "$resdir" -o ! -d "$resdir" -o ! -w "$resdir" | ||
58 | then | ||
59 | echo "kvm-test-1-rcu.sh :$resdir: Not a writable directory, cannot build into it" | ||
60 | exit 1 | ||
61 | fi | ||
62 | cp $config_template $resdir/ConfigFragment | ||
63 | echo ' ---' `date`: Starting build | ||
64 | cat << '___EOF___' >> $T | ||
65 | CONFIG_RCU_TORTURE_TEST=y | ||
66 | ___EOF___ | ||
67 | # Optimizations below this point | ||
68 | # CONFIG_USB=n | ||
69 | # CONFIG_SECURITY=n | ||
70 | # CONFIG_NFS_FS=n | ||
71 | # CONFIG_SOUND=n | ||
72 | # CONFIG_INPUT_JOYSTICK=n | ||
73 | # CONFIG_INPUT_TABLET=n | ||
74 | # CONFIG_INPUT_TOUCHSCREEN=n | ||
75 | # CONFIG_INPUT_MISC=n | ||
76 | # CONFIG_INPUT_MOUSE=n | ||
77 | # # CONFIG_NET=n # disables console access, so accept the slower build. | ||
78 | # CONFIG_SCSI=n | ||
79 | # CONFIG_ATA=n | ||
80 | # CONFIG_FAT_FS=n | ||
81 | # CONFIG_MSDOS_FS=n | ||
82 | # CONFIG_VFAT_FS=n | ||
83 | # CONFIG_ISO9660_FS=n | ||
84 | # CONFIG_QUOTA=n | ||
85 | # CONFIG_HID=n | ||
86 | # CONFIG_CRYPTO=n | ||
87 | # CONFIG_PCCARD=n | ||
88 | # CONFIG_PCMCIA=n | ||
89 | # CONFIG_CARDBUS=n | ||
90 | # CONFIG_YENTA=n | ||
91 | if kvm-build.sh $config_template $builddir $T | ||
92 | then | ||
93 | cp $builddir/Make*.out $resdir | ||
94 | cp $builddir/.config $resdir | ||
95 | cp $builddir/arch/x86/boot/bzImage $resdir | ||
96 | parse-build.sh $resdir/Make.out $title | ||
97 | else | ||
98 | cp $builddir/Make*.out $resdir | ||
99 | echo Build failed, not running KVM, see $resdir. | ||
100 | exit 1 | ||
101 | fi | ||
102 | minutes=$4 | ||
103 | seconds=$(($minutes * 60)) | ||
104 | qemu_args=$5 | ||
105 | boot_args=$6 | ||
106 | |||
107 | cd $KVM | ||
108 | kstarttime=`awk 'BEGIN { print systime() }' < /dev/null` | ||
109 | echo ' ---' `date`: Starting kernel | ||
110 | if file linux-2.6/*.o | grep -q 64-bit | ||
111 | then | ||
112 | QEMU=qemu-system-x86_64 | ||
113 | else | ||
114 | QEMU=qemu-system-i386 | ||
115 | fi | ||
116 | |||
117 | # Generate -smp qemu argument. | ||
118 | cpu_count=`configNR_CPUS.sh $config_template` | ||
119 | ncpus=`grep '^processor' /proc/cpuinfo | wc -l` | ||
120 | if test $cpu_count -gt $ncpus | ||
121 | then | ||
122 | echo CPU count limited from $cpu_count to $ncpus | ||
123 | touch $resdir/Warnings | ||
124 | echo CPU count limited from $cpu_count to $ncpus >> $resdir/Warnings | ||
125 | cpu_count=$ncpus | ||
126 | fi | ||
127 | if echo $qemu_args | grep -q -e -smp | ||
128 | then | ||
129 | echo CPU count specified by caller | ||
130 | else | ||
131 | qemu_args="$qemu_args -smp $cpu_count" | ||
132 | fi | ||
133 | |||
134 | # Generate CPU-hotplug boot parameters | ||
135 | if ! bootparam_hotplug_cpu "$bootargs" | ||
136 | then | ||
137 | if configfrag_hotplug_cpu $builddir/.config | ||
138 | then | ||
139 | echo Kernel configured for CPU hotplug, adding rcutorture. | ||
140 | bootargs="$bootargs rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30" | ||
141 | fi | ||
142 | fi | ||
143 | |||
144 | 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 | ||
145 | $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" & | ||
146 | qemu_pid=$! | ||
147 | commandcompleted=0 | ||
148 | echo Monitoring qemu job at pid $qemu_pid | ||
149 | for ((i=0;i<$seconds;i++)) | ||
150 | do | ||
151 | if kill -0 $qemu_pid > /dev/null 2>&1 | ||
152 | then | ||
153 | sleep 1 | ||
154 | else | ||
155 | commandcompleted=1 | ||
156 | kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` | ||
157 | if test $kruntime -lt $seconds | ||
158 | then | ||
159 | echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1 | ||
160 | else | ||
161 | echo ' ---' `date`: Kernel done | ||
162 | fi | ||
163 | break | ||
164 | fi | ||
165 | done | ||
166 | if test $commandcompleted -eq 0 | ||
167 | then | ||
168 | echo Grace period for qemu job at pid $qemu_pid | ||
169 | for ((i=0;i<=$grace;i++)) | ||
170 | do | ||
171 | if kill -0 $qemu_pid > /dev/null 2>&1 | ||
172 | then | ||
173 | sleep 1 | ||
174 | else | ||
175 | break | ||
176 | fi | ||
177 | if test $i -eq $grace | ||
178 | then | ||
179 | kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }'` | ||
180 | echo "!!! Hang at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1 | ||
181 | kill -KILL $qemu_pid | ||
182 | fi | ||
183 | done | ||
184 | fi | ||
185 | |||
186 | cp $builddir/console.log $resdir | ||
187 | parse-rcutorture.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 | ||
188 | parse-console.sh $resdir/console.log $title >> $resdir/Warnings 2>&1 | ||
189 | cat $resdir/Warnings | ||
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh new file mode 100644 index 000000000000..46c75ee2f528 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh | |||
@@ -0,0 +1,173 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Run a series of 14 tests under KVM. These are not particularly | ||
4 | # well-selected or well-tuned, but are the current set. Run from the | ||
5 | # top level of the source tree. | ||
6 | # | ||
7 | # Edit the definitions below to set the locations of the various directories, | ||
8 | # as well as the test duration. | ||
9 | # | ||
10 | # Usage: sh kvm.sh [ options ] | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License as published by | ||
14 | # the Free Software Foundation; either version 2 of the License, or | ||
15 | # (at your option) any later version. | ||
16 | # | ||
17 | # This program is distributed in the hope that it will be useful, | ||
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | # GNU General Public License for more details. | ||
21 | # | ||
22 | # You should have received a copy of the GNU General Public License | ||
23 | # along with this program; if not, write to the Free Software | ||
24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
25 | # | ||
26 | # Copyright (C) IBM Corporation, 2011 | ||
27 | # | ||
28 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
29 | |||
30 | scriptname=$0 | ||
31 | |||
32 | dur=30 | ||
33 | KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM | ||
34 | builddir=${KVM}/b1 | ||
35 | resdir="" | ||
36 | configs=" sysidleY.2013.06.19a \ | ||
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" | ||
53 | |||
54 | usage () { | ||
55 | echo "Usage: $scriptname optional arguments:" | ||
56 | echo " --builddir absolute-pathname" | ||
57 | echo " --configs \"config-file list\"" | ||
58 | echo " --duration minutes" | ||
59 | echo " --rcu-kvm absolute-pathname" | ||
60 | echo " --results absolute-pathname" | ||
61 | echo " --relbuilddir relative-pathname" | ||
62 | exit 1 | ||
63 | } | ||
64 | |||
65 | # checkarg --argname argtype $# arg mustmatch cannotmatch | ||
66 | checkarg () { | ||
67 | if test $3 -le 1 | ||
68 | then | ||
69 | echo $1 needs argument $2 matching \"$5\" | ||
70 | usage | ||
71 | fi | ||
72 | if echo "$4" | grep -q -e "$5" | ||
73 | then | ||
74 | : | ||
75 | else | ||
76 | echo $1 $2 \"$4\" must match \"$5\" | ||
77 | usage | ||
78 | fi | ||
79 | if echo "$4" | grep -q -e "$6" | ||
80 | then | ||
81 | echo $1 $2 \"$4\" must not match \"$6\" | ||
82 | usage | ||
83 | fi | ||
84 | } | ||
85 | |||
86 | while test $# -gt 0 | ||
87 | do | ||
88 | echo ":$1:" | ||
89 | case "$1" in | ||
90 | --builddir) | ||
91 | checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' error | ||
92 | builddir=$2 | ||
93 | gotbuilddir=1 | ||
94 | shift | ||
95 | ;; | ||
96 | --configs) | ||
97 | checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--' | ||
98 | configs="$2" | ||
99 | shift | ||
100 | ;; | ||
101 | --duration) | ||
102 | checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' error | ||
103 | dur=$2 | ||
104 | shift | ||
105 | ;; | ||
106 | --rcu-kvm) | ||
107 | checkarg --rcu-kvm "(absolute pathname)" "$#" "$2" '^/' error | ||
108 | KVM=$2; export KVM | ||
109 | if -z "$gotbuilddir" | ||
110 | then | ||
111 | builddir=${KVM}/b1 | ||
112 | fi | ||
113 | if -n "$gotrelbuilddir" | ||
114 | then | ||
115 | builddir=${KVM}/${relbuilddir} | ||
116 | fi | ||
117 | shift | ||
118 | ;; | ||
119 | --relbuilddir) | ||
120 | checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--' | ||
121 | relbuilddir=$2 | ||
122 | gotrelbuilddir=1 | ||
123 | builddir=${KVM}/${relbuilddir} | ||
124 | shift | ||
125 | ;; | ||
126 | --results) | ||
127 | checkarg --results "(absolute pathname)" "$#" "$2" '^/' error | ||
128 | resdir=$2 | ||
129 | shift | ||
130 | ;; | ||
131 | *) | ||
132 | usage | ||
133 | ;; | ||
134 | esac | ||
135 | shift | ||
136 | done | ||
137 | |||
138 | echo "builddir=$builddir" | ||
139 | echo "dur=$dur" | ||
140 | echo "KVM=$KVM" | ||
141 | echo "resdir=$resdir" | ||
142 | |||
143 | PATH=${KVM}/bin:$PATH; export PATH | ||
144 | CONFIGFRAG=${KVM}/configs; export CONFIGFRAG | ||
145 | |||
146 | if test -z "$resdir" | ||
147 | then | ||
148 | resdir=$KVM/res | ||
149 | mkdir $resdir || : | ||
150 | ds=`date +%Y.%m.%d-%H:%M:%S` | ||
151 | mkdir $resdir/$ds | ||
152 | echo Datestamp: $ds | ||
153 | else | ||
154 | mkdir -p "$resdir" | ||
155 | ds="" | ||
156 | fi | ||
157 | pwd > $resdir/$ds/testid.txt | ||
158 | if test -d .git | ||
159 | then | ||
160 | git status >> $resdir/$ds/testid.txt | ||
161 | git rev-parse HEAD >> $resdir/$ds/testid.txt | ||
162 | fi | ||
163 | builddir=$KVM/b1 | ||
164 | mkdir $builddir || : | ||
165 | |||
166 | for CF in $configs | ||
167 | do | ||
168 | rd=$resdir/$ds/$CF | ||
169 | mkdir $rd || : | ||
170 | echo Results directory: $rd | ||
171 | kvm-test-1-rcu.sh $CONFIGFRAG/$CF $builddir $rd $dur "-nographic" "rcutorture.test_no_idle_hz=1 rcutorture.n_barrier_cbs=4 rcutorture.verbose=1" | ||
172 | done | ||
173 | # 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/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/parse-build.sh new file mode 100755 index 000000000000..2e0e9f7ebbb0 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/parse-build.sh | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Check the build output from an rcutorture run for goodness. | ||
4 | # The "file" is a pathname on the local system, and "title" is | ||
5 | # a text string for error-message purposes. | ||
6 | # | ||
7 | # The file must contain kernel build output. | ||
8 | # | ||
9 | # Usage: | ||
10 | # sh parse-build.sh file title | ||
11 | # | ||
12 | # This program is free software; you can redistribute it and/or modify | ||
13 | # it under the terms of the GNU General Public License as published by | ||
14 | # the Free Software Foundation; either version 2 of the License, or | ||
15 | # (at your option) any later version. | ||
16 | # | ||
17 | # This program is distributed in the hope that it will be useful, | ||
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | # GNU General Public License for more details. | ||
21 | # | ||
22 | # You should have received a copy of the GNU General Public License | ||
23 | # along with this program; if not, write to the Free Software | ||
24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
25 | # | ||
26 | # Copyright (C) IBM Corporation, 2011 | ||
27 | # | ||
28 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
29 | |||
30 | T=$1 | ||
31 | title=$2 | ||
32 | |||
33 | if grep -q CC < $T | ||
34 | then | ||
35 | : | ||
36 | else | ||
37 | echo $title no build | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | if egrep -q "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T | ||
42 | then | ||
43 | echo $title build errors: | ||
44 | egrep "error:|rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T | ||
45 | exit 2 | ||
46 | fi | ||
47 | exit 0 | ||
diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh new file mode 100755 index 000000000000..bc1496fa1263 --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh | |||
@@ -0,0 +1,39 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Check the console output from an rcutorture run for oopses. | ||
4 | # The "file" is a pathname on the local system, and "title" is | ||
5 | # a text string for error-message purposes. | ||
6 | # | ||
7 | # Usage: | ||
8 | # sh parse-console.sh file title | ||
9 | # | ||
10 | # This program is free software; you can redistribute it and/or modify | ||
11 | # it under the terms of the GNU General Public License as published by | ||
12 | # the Free Software Foundation; either version 2 of the License, or | ||
13 | # (at your option) any later version. | ||
14 | # | ||
15 | # This program is distributed in the hope that it will be useful, | ||
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | # GNU General Public License for more details. | ||
19 | # | ||
20 | # You should have received a copy of the GNU General Public License | ||
21 | # along with this program; if not, write to the Free Software | ||
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
23 | # | ||
24 | # Copyright (C) IBM Corporation, 2011 | ||
25 | # | ||
26 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
27 | |||
28 | T=/tmp/abat-chk-badness.sh.$$ | ||
29 | trap 'rm -f $T' 0 | ||
30 | |||
31 | file="$1" | ||
32 | title="$2" | ||
33 | |||
34 | egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T | ||
35 | if test -s $T | ||
36 | then | ||
37 | echo Assertion failure in $file $title | ||
38 | cat $T | ||
39 | fi | ||
diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh new file mode 100755 index 000000000000..37368a046a9f --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh | |||
@@ -0,0 +1,104 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Check the console output from an rcutorture run for goodness. | ||
4 | # The "file" is a pathname on the local system, and "title" is | ||
5 | # a text string for error-message purposes. | ||
6 | # | ||
7 | # The file must contain rcutorture output, but can be interspersed | ||
8 | # with other dmesg text. | ||
9 | # | ||
10 | # Usage: | ||
11 | # sh parse-rcutorture.sh file title | ||
12 | # | ||
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 | ||
15 | # the Free Software Foundation; either version 2 of the License, or | ||
16 | # (at your option) any later version. | ||
17 | # | ||
18 | # This program is distributed in the hope that it will be useful, | ||
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | # GNU General Public License for more details. | ||
22 | # | ||
23 | # You should have received a copy of the GNU General Public License | ||
24 | # along with this program; if not, write to the Free Software | ||
25 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
26 | # | ||
27 | # Copyright (C) IBM Corporation, 2011 | ||
28 | # | ||
29 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
30 | |||
31 | T=/tmp/parse-rcutorture.sh.$$ | ||
32 | file="$1" | ||
33 | title="$2" | ||
34 | |||
35 | trap 'rm -f $T.seq' 0 | ||
36 | |||
37 | # check for presence of rcutorture.txt file | ||
38 | |||
39 | if test -f "$file" -a -r "$file" | ||
40 | then | ||
41 | : | ||
42 | else | ||
43 | echo $title unreadable rcutorture.txt file: $file | ||
44 | exit 1 | ||
45 | fi | ||
46 | |||
47 | # check for abject failure | ||
48 | |||
49 | if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file | ||
50 | then | ||
51 | nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` | ||
52 | echo $title FAILURE, $nerrs instances | ||
53 | echo " " $url | ||
54 | exit | ||
55 | fi | ||
56 | |||
57 | grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' | | ||
58 | awk ' | ||
59 | BEGIN { | ||
60 | ver = 0; | ||
61 | badseq = 0; | ||
62 | } | ||
63 | |||
64 | { | ||
65 | if (!badseq && ($5 + 0 != $5 || $5 <= ver)) { | ||
66 | badseqno1 = ver; | ||
67 | badseqno2 = $5; | ||
68 | badseqnr = NR; | ||
69 | badseq = 1; | ||
70 | } | ||
71 | ver = $5 | ||
72 | } | ||
73 | |||
74 | END { | ||
75 | if (badseq) { | ||
76 | if (badseqno1 == badseqno2 && badseqno2 == ver) | ||
77 | print "RCU GP HANG at " ver " rcutorture stat " badseqnr; | ||
78 | else | ||
79 | print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr; | ||
80 | } | ||
81 | }' > $T.seq | ||
82 | |||
83 | if grep -q SUCCESS $file | ||
84 | then | ||
85 | if test -s $T.seq | ||
86 | then | ||
87 | echo WARNING $title `cat $T.seq` | ||
88 | echo " " $file | ||
89 | exit 2 | ||
90 | fi | ||
91 | else | ||
92 | if grep -q RCU_HOTPLUG $file | ||
93 | then | ||
94 | echo WARNING: HOTPLUG FAILURES $title `cat $T.seq` | ||
95 | echo " " $file | ||
96 | exit 3 | ||
97 | fi | ||
98 | echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages | ||
99 | if test -s $T.seq | ||
100 | then | ||
101 | echo WARNING $title `cat $T.seq` | ||
102 | fi | ||
103 | exit 2 | ||
104 | fi | ||
diff --git a/tools/testing/selftests/rcutorture/configs/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/N1-S-T-NH-SD-SMP-HP new file mode 100644 index 000000000000..d81e11d280aa --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N1-S-T-NH-SD-SMP-HP | |||
@@ -0,0 +1,19 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_RCU_FAST_NO_HZ=y | ||
3 | CONFIG_NO_HZ=y | ||
4 | CONFIG_SMP=y | ||
5 | CONFIG_RCU_FANOUT=8 | ||
6 | CONFIG_NR_CPUS=8 | ||
7 | CONFIG_RCU_FANOUT_EXACT=n | ||
8 | CONFIG_HOTPLUG_CPU=y | ||
9 | CONFIG_PREEMPT_NONE=y | ||
10 | CONFIG_PREEMPT_VOLUNTARY=n | ||
11 | CONFIG_PREEMPT=n | ||
12 | #CHECK#CONFIG_TREE_RCU=y | ||
13 | CONFIG_RCU_TORTURE_TEST=m | ||
14 | CONFIG_MODULE_UNLOAD=y | ||
15 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
16 | CONFIG_IKCONFIG=y | ||
17 | CONFIG_IKCONFIG_PROC=y | ||
18 | CONFIG_PRINTK_TIME=y | ||
19 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/N2-2-t-nh-sd-SMP-hp new file mode 100644 index 000000000000..02e418572b1b --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N2-2-t-nh-sd-SMP-hp | |||
@@ -0,0 +1,20 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=4 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=n | ||
8 | CONFIG_SUSPEND=n | ||
9 | CONFIG_HIBERNATION=n | ||
10 | CONFIG_PREEMPT_NONE=y | ||
11 | CONFIG_PREEMPT_VOLUNTARY=n | ||
12 | CONFIG_PREEMPT=n | ||
13 | #CHECK#CONFIG_TREE_RCU=y | ||
14 | CONFIG_RCU_TORTURE_TEST=m | ||
15 | CONFIG_MODULE_UNLOAD=y | ||
16 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
17 | CONFIG_IKCONFIG=y | ||
18 | CONFIG_IKCONFIG_PROC=y | ||
19 | CONFIG_PRINTK_TIME=y | ||
20 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/N3-3-T-nh-SD-SMP-hp new file mode 100644 index 000000000000..b3100f69c8cf --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N3-3-T-nh-SD-SMP-hp | |||
@@ -0,0 +1,22 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=n | ||
8 | CONFIG_SUSPEND=n | ||
9 | CONFIG_HIBERNATION=n | ||
10 | CONFIG_PREEMPT_NONE=y | ||
11 | CONFIG_PREEMPT_VOLUNTARY=n | ||
12 | CONFIG_PREEMPT=n | ||
13 | #CHECK#CONFIG_TREE_RCU=y | ||
14 | CONFIG_RCU_TORTURE_TEST=m | ||
15 | CONFIG_MODULE_UNLOAD=y | ||
16 | CONFIG_PROVE_LOCKING=y | ||
17 | CONFIG_PROVE_RCU=y | ||
18 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
19 | CONFIG_IKCONFIG=y | ||
20 | CONFIG_IKCONFIG_PROC=y | ||
21 | CONFIG_PRINTK_TIME=y | ||
22 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/N4-A-t-NH-sd-SMP-HP new file mode 100644 index 000000000000..c56b44530725 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N4-A-t-NH-sd-SMP-HP | |||
@@ -0,0 +1,18 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=6 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=y | ||
8 | CONFIG_PREEMPT_NONE=y | ||
9 | CONFIG_PREEMPT_VOLUNTARY=n | ||
10 | CONFIG_PREEMPT=n | ||
11 | #CHECK#CONFIG_TREE_RCU=y | ||
12 | CONFIG_RCU_TORTURE_TEST=m | ||
13 | CONFIG_MODULE_UNLOAD=y | ||
14 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
15 | CONFIG_IKCONFIG=y | ||
16 | CONFIG_IKCONFIG_PROC=y | ||
17 | CONFIG_PRINTK_TIME=y | ||
18 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/N5-U-T-NH-sd-SMP-hp new file mode 100644 index 000000000000..90d924fea9e9 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N5-U-T-NH-sd-SMP-hp | |||
@@ -0,0 +1,22 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_DEBUG_KERNEL=y | ||
3 | CONFIG_RCU_CPU_STALL_INFO=y | ||
4 | CONFIG_NO_HZ=y | ||
5 | CONFIG_SMP=y | ||
6 | CONFIG_RCU_FANOUT=6 | ||
7 | CONFIG_NR_CPUS=8 | ||
8 | CONFIG_RCU_FANOUT_EXACT=y | ||
9 | CONFIG_HOTPLUG_CPU=n | ||
10 | CONFIG_SUSPEND=n | ||
11 | CONFIG_HIBERNATION=n | ||
12 | CONFIG_PREEMPT_NONE=y | ||
13 | CONFIG_PREEMPT_VOLUNTARY=n | ||
14 | CONFIG_PREEMPT=n | ||
15 | #CHECK#CONFIG_TREE_RCU=y | ||
16 | CONFIG_RCU_TORTURE_TEST=m | ||
17 | CONFIG_MODULE_UNLOAD=y | ||
18 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
19 | CONFIG_IKCONFIG=y | ||
20 | CONFIG_IKCONFIG_PROC=y | ||
21 | CONFIG_PRINTK_TIME=y | ||
22 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N6---t-nh-SD-smp-hp b/tools/testing/selftests/rcutorture/configs/N6---t-nh-SD-smp-hp new file mode 100644 index 000000000000..0ccc36d72738 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N6---t-nh-SD-smp-hp | |||
@@ -0,0 +1,19 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_NR_CPUS=1 | ||
5 | CONFIG_RCU_FANOUT_EXACT=n | ||
6 | CONFIG_HOTPLUG_CPU=n | ||
7 | CONFIG_SUSPEND=n | ||
8 | CONFIG_HIBERNATION=n | ||
9 | CONFIG_PREEMPT_NONE=y | ||
10 | CONFIG_PREEMPT_VOLUNTARY=n | ||
11 | CONFIG_PREEMPT=n | ||
12 | #CHECK#CONFIG_TREE_RCU=y | ||
13 | CONFIG_RCU_TORTURE_TEST=m | ||
14 | CONFIG_MODULE_UNLOAD=y | ||
15 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
16 | CONFIG_IKCONFIG=y | ||
17 | CONFIG_IKCONFIG_PROC=y | ||
18 | CONFIG_PRINTK_TIME=y | ||
19 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N7-4-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/N7-4-T-NH-SD-SMP-HP new file mode 100644 index 000000000000..3f640cf84973 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N7-4-T-NH-SD-SMP-HP | |||
@@ -0,0 +1,26 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_DEBUG_KERNEL=y | ||
3 | CONFIG_RCU_CPU_STALL_INFO=y | ||
4 | CONFIG_NO_HZ=y | ||
5 | CONFIG_SMP=y | ||
6 | CONFIG_RCU_FANOUT=2 | ||
7 | CONFIG_NR_CPUS=16 | ||
8 | CONFIG_RCU_FANOUT_EXACT=n | ||
9 | CONFIG_HOTPLUG_CPU=y | ||
10 | CONFIG_RCU_NOCB_CPU=y | ||
11 | CONFIG_RCU_NOCB_CPU_NONE=y | ||
12 | CONFIG_RCU_NOCB_CPU_ZERO=n | ||
13 | CONFIG_RCU_NOCB_CPU_ALL=n | ||
14 | CONFIG_SUSPEND=n | ||
15 | CONFIG_HIBERNATION=n | ||
16 | CONFIG_PREEMPT_NONE=y | ||
17 | CONFIG_PREEMPT_VOLUNTARY=n | ||
18 | CONFIG_PREEMPT=n | ||
19 | #CHECK#CONFIG_TREE_RCU=y | ||
20 | CONFIG_RCU_TORTURE_TEST=m | ||
21 | CONFIG_MODULE_UNLOAD=y | ||
22 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
23 | CONFIG_IKCONFIG=y | ||
24 | CONFIG_IKCONFIG_PROC=y | ||
25 | CONFIG_PRINTK_TIME=y | ||
26 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/N8-2-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/N8-2-T-NH-SD-SMP-HP new file mode 100644 index 000000000000..285da2dd8ac3 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/N8-2-T-NH-SD-SMP-HP | |||
@@ -0,0 +1,22 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_DEBUG_KERNEL=y | ||
3 | CONFIG_RCU_CPU_STALL_INFO=y | ||
4 | CONFIG_NO_HZ=y | ||
5 | CONFIG_SMP=y | ||
6 | CONFIG_RCU_FANOUT=14 | ||
7 | CONFIG_NR_CPUS=16 | ||
8 | CONFIG_RCU_FANOUT_EXACT=y | ||
9 | CONFIG_HOTPLUG_CPU=y | ||
10 | CONFIG_SUSPEND=n | ||
11 | CONFIG_HIBERNATION=n | ||
12 | CONFIG_PREEMPT_NONE=y | ||
13 | CONFIG_PREEMPT_VOLUNTARY=n | ||
14 | CONFIG_PREEMPT=n | ||
15 | #CHECK#CONFIG_TREE_RCU=y | ||
16 | CONFIG_RCU_TORTURE_TEST=m | ||
17 | CONFIG_MODULE_UNLOAD=y | ||
18 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
19 | CONFIG_IKCONFIG=y | ||
20 | CONFIG_IKCONFIG_PROC=y | ||
21 | CONFIG_PRINTK_TIME=y | ||
22 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/NT1-nh b/tools/testing/selftests/rcutorture/configs/NT1-nh new file mode 100644 index 000000000000..023f312a931c --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/NT1-nh | |||
@@ -0,0 +1,23 @@ | |||
1 | #CHECK#CONFIG_TINY_RCU=y | ||
2 | CONFIG_RCU_TRACE=y | ||
3 | CONFIG_RCU_TORTURE_TEST=m | ||
4 | CONFIG_MODULE_UNLOAD=y | ||
5 | CONFIG_SUSPEND=n | ||
6 | CONFIG_HIBERNATION=n | ||
7 | # | ||
8 | CONFIG_SMP=n | ||
9 | # | ||
10 | CONFIG_HOTPLUG_CPU=n | ||
11 | # | ||
12 | CONFIG_NO_HZ=n | ||
13 | # | ||
14 | CONFIG_PREEMPT_NONE=y | ||
15 | CONFIG_PREEMPT_VOLUNTARY=n | ||
16 | CONFIG_PREEMPT=n | ||
17 | CONFIG_PROVE_LOCKING=y | ||
18 | CONFIG_PROVE_RCU=y | ||
19 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
20 | CONFIG_IKCONFIG=y | ||
21 | CONFIG_IKCONFIG_PROC=y | ||
22 | CONFIG_PRINTK_TIME=y | ||
23 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/NT3-NH b/tools/testing/selftests/rcutorture/configs/NT3-NH new file mode 100644 index 000000000000..6fd0235dae73 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/NT3-NH | |||
@@ -0,0 +1,20 @@ | |||
1 | #CHECK#CONFIG_TINY_RCU=y | ||
2 | CONFIG_RCU_TORTURE_TEST=m | ||
3 | CONFIG_MODULE_UNLOAD=y | ||
4 | CONFIG_SUSPEND=n | ||
5 | CONFIG_HIBERNATION=n | ||
6 | # | ||
7 | CONFIG_SMP=n | ||
8 | # | ||
9 | CONFIG_HOTPLUG_CPU=n | ||
10 | # | ||
11 | CONFIG_NO_HZ=y | ||
12 | # | ||
13 | CONFIG_PREEMPT_NONE=y | ||
14 | CONFIG_PREEMPT_VOLUNTARY=n | ||
15 | CONFIG_PREEMPT=n | ||
16 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
17 | CONFIG_IKCONFIG=y | ||
18 | CONFIG_IKCONFIG_PROC=y | ||
19 | CONFIG_PRINTK_TIME=y | ||
20 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/P1-S-T-NH-SD-SMP-HP new file mode 100644 index 000000000000..9647c44cf4b7 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P1-S-T-NH-SD-SMP-HP | |||
@@ -0,0 +1,20 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_RCU_CPU_STALL_INFO=y | ||
3 | CONFIG_NO_HZ=y | ||
4 | CONFIG_RCU_FAST_NO_HZ=y | ||
5 | CONFIG_SMP=y | ||
6 | CONFIG_RCU_FANOUT=8 | ||
7 | CONFIG_NR_CPUS=8 | ||
8 | CONFIG_RCU_FANOUT_EXACT=n | ||
9 | CONFIG_HOTPLUG_CPU=y | ||
10 | CONFIG_PREEMPT_NONE=n | ||
11 | CONFIG_PREEMPT_VOLUNTARY=n | ||
12 | CONFIG_PREEMPT=y | ||
13 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
14 | CONFIG_RCU_TORTURE_TEST=m | ||
15 | CONFIG_MODULE_UNLOAD=y | ||
16 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
17 | CONFIG_IKCONFIG=y | ||
18 | CONFIG_IKCONFIG_PROC=y | ||
19 | CONFIG_PRINTK_TIME=y | ||
20 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/P2-2-t-nh-sd-SMP-hp new file mode 100644 index 000000000000..0f3b667d2a9f --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P2-2-t-nh-sd-SMP-hp | |||
@@ -0,0 +1,20 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=4 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=n | ||
8 | CONFIG_SUSPEND=n | ||
9 | CONFIG_HIBERNATION=n | ||
10 | CONFIG_PREEMPT_NONE=n | ||
11 | CONFIG_PREEMPT_VOLUNTARY=n | ||
12 | CONFIG_PREEMPT=y | ||
13 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
14 | CONFIG_RCU_TORTURE_TEST=m | ||
15 | CONFIG_MODULE_UNLOAD=y | ||
16 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
17 | CONFIG_IKCONFIG=y | ||
18 | CONFIG_IKCONFIG_PROC=y | ||
19 | CONFIG_PRINTK_TIME=y | ||
20 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/P3-3-T-nh-SD-SMP-hp new file mode 100644 index 000000000000..b035e141bf2a --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P3-3-T-nh-SD-SMP-hp | |||
@@ -0,0 +1,20 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=n | ||
8 | CONFIG_SUSPEND=n | ||
9 | CONFIG_HIBERNATION=n | ||
10 | CONFIG_PREEMPT_NONE=n | ||
11 | CONFIG_PREEMPT_VOLUNTARY=n | ||
12 | CONFIG_PREEMPT=y | ||
13 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
14 | CONFIG_RCU_TORTURE_TEST=m | ||
15 | CONFIG_MODULE_UNLOAD=y | ||
16 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
17 | CONFIG_IKCONFIG=y | ||
18 | CONFIG_IKCONFIG_PROC=y | ||
19 | CONFIG_PRINTK_TIME=y | ||
20 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/P4-A-t-NH-sd-SMP-HP new file mode 100644 index 000000000000..3ccf6a9447f5 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P4-A-t-NH-sd-SMP-HP | |||
@@ -0,0 +1,22 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=6 | ||
5 | CONFIG_NR_CPUS=8 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=y | ||
8 | CONFIG_PREEMPT_NONE=n | ||
9 | CONFIG_PREEMPT_VOLUNTARY=n | ||
10 | CONFIG_PREEMPT=y | ||
11 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
12 | CONFIG_RCU_TORTURE_TEST=m | ||
13 | CONFIG_MODULE_UNLOAD=y | ||
14 | CONFIG_RT_MUTEXES=y | ||
15 | CONFIG_RCU_BOOST=y | ||
16 | CONFIG_RCU_BOOST_PRIO=2 | ||
17 | CONFIG_PROVE_LOCKING=y | ||
18 | CONFIG_PROVE_RCU=y | ||
19 | CONFIG_IKCONFIG=y | ||
20 | CONFIG_IKCONFIG_PROC=y | ||
21 | CONFIG_PRINTK_TIME=y | ||
22 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/P5-U-T-NH-sd-SMP-hp new file mode 100644 index 000000000000..ef624ce73d8e --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P5-U-T-NH-sd-SMP-hp | |||
@@ -0,0 +1,28 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_RCU_CPU_STALL_INFO=y | ||
3 | CONFIG_NO_HZ=y | ||
4 | CONFIG_SMP=y | ||
5 | CONFIG_RCU_FANOUT=6 | ||
6 | CONFIG_NR_CPUS=8 | ||
7 | CONFIG_RCU_FANOUT_EXACT=y | ||
8 | CONFIG_HOTPLUG_CPU=n | ||
9 | CONFIG_SUSPEND=n | ||
10 | CONFIG_HIBERNATION=n | ||
11 | CONFIG_PREEMPT_NONE=n | ||
12 | CONFIG_PREEMPT_VOLUNTARY=n | ||
13 | CONFIG_PREEMPT=y | ||
14 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
15 | CONFIG_DEBUG_KERNEL=y | ||
16 | CONFIG_PROVE_RCU_DELAY=y | ||
17 | CONFIG_DEBUG_OBJECTS=y | ||
18 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
19 | CONFIG_RT_MUTEXES=y | ||
20 | CONFIG_RCU_BOOST=y | ||
21 | CONFIG_RCU_BOOST_PRIO=2 | ||
22 | CONFIG_RCU_TORTURE_TEST=m | ||
23 | CONFIG_MODULE_UNLOAD=y | ||
24 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
25 | CONFIG_IKCONFIG=y | ||
26 | CONFIG_IKCONFIG_PROC=y | ||
27 | CONFIG_PRINTK_TIME=y | ||
28 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P6---t-nh-SD-smp-hp b/tools/testing/selftests/rcutorture/configs/P6---t-nh-SD-smp-hp new file mode 100644 index 000000000000..f4c9175828bf --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P6---t-nh-SD-smp-hp | |||
@@ -0,0 +1,18 @@ | |||
1 | CONFIG_RCU_TRACE=n | ||
2 | CONFIG_NO_HZ=n | ||
3 | CONFIG_SMP=n | ||
4 | CONFIG_RCU_FANOUT_EXACT=n | ||
5 | CONFIG_HOTPLUG_CPU=n | ||
6 | CONFIG_SUSPEND=n | ||
7 | CONFIG_HIBERNATION=n | ||
8 | CONFIG_PREEMPT_NONE=n | ||
9 | CONFIG_PREEMPT_VOLUNTARY=n | ||
10 | CONFIG_PREEMPT=y | ||
11 | CONFIG_TREE_PREEMPT_RCU=y | ||
12 | CONFIG_RCU_TORTURE_TEST=m | ||
13 | CONFIG_MODULE_UNLOAD=y | ||
14 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
15 | CONFIG_IKCONFIG=y | ||
16 | CONFIG_IKCONFIG_PROC=y | ||
17 | CONFIG_PRINTK_TIME=y | ||
18 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP new file mode 100644 index 000000000000..77a8c5b75763 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP | |||
@@ -0,0 +1,30 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=16 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=y | ||
8 | CONFIG_RCU_NOCB_CPU=y | ||
9 | CONFIG_RCU_NOCB_CPU_NONE=n | ||
10 | CONFIG_RCU_NOCB_CPU_ZERO=n | ||
11 | CONFIG_RCU_NOCB_CPU_ALL=y | ||
12 | CONFIG_SUSPEND=n | ||
13 | CONFIG_HIBERNATION=n | ||
14 | CONFIG_PREEMPT_NONE=n | ||
15 | CONFIG_PREEMPT_VOLUNTARY=n | ||
16 | CONFIG_PREEMPT=y | ||
17 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
18 | CONFIG_RCU_TORTURE_TEST=m | ||
19 | CONFIG_MODULE_UNLOAD=y | ||
20 | CONFIG_PROVE_LOCKING=y | ||
21 | CONFIG_PROVE_RCU=y | ||
22 | CONFIG_DEBUG_KERNEL=y | ||
23 | CONFIG_DEBUG_OBJECTS=y | ||
24 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
25 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
26 | CONFIG_SLUB=y | ||
27 | CONFIG_IKCONFIG=y | ||
28 | CONFIG_IKCONFIG_PROC=y | ||
29 | CONFIG_PRINTK_TIME=y | ||
30 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-all b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-all new file mode 100644 index 000000000000..0eecebc6e95f --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-all | |||
@@ -0,0 +1,30 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=16 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=y | ||
8 | CONFIG_RCU_NOCB_CPU=y | ||
9 | CONFIG_RCU_NOCB_CPU_NONE=y | ||
10 | CONFIG_RCU_NOCB_CPU_ZERO=n | ||
11 | CONFIG_RCU_NOCB_CPU_ALL=n | ||
12 | CONFIG_SUSPEND=n | ||
13 | CONFIG_HIBERNATION=n | ||
14 | CONFIG_PREEMPT_NONE=n | ||
15 | CONFIG_PREEMPT_VOLUNTARY=n | ||
16 | CONFIG_PREEMPT=y | ||
17 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
18 | CONFIG_RCU_TORTURE_TEST=m | ||
19 | CONFIG_MODULE_UNLOAD=y | ||
20 | CONFIG_PROVE_LOCKING=y | ||
21 | CONFIG_PROVE_RCU=y | ||
22 | CONFIG_DEBUG_KERNEL=y | ||
23 | CONFIG_DEBUG_OBJECTS=y | ||
24 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
25 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
26 | CONFIG_SLUB=y | ||
27 | CONFIG_IKCONFIG=y | ||
28 | CONFIG_IKCONFIG_PROC=y | ||
29 | CONFIG_PRINTK_TIME=y | ||
30 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-none b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-none new file mode 100644 index 000000000000..0eecebc6e95f --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-HP-none | |||
@@ -0,0 +1,30 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=16 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=y | ||
8 | CONFIG_RCU_NOCB_CPU=y | ||
9 | CONFIG_RCU_NOCB_CPU_NONE=y | ||
10 | CONFIG_RCU_NOCB_CPU_ZERO=n | ||
11 | CONFIG_RCU_NOCB_CPU_ALL=n | ||
12 | CONFIG_SUSPEND=n | ||
13 | CONFIG_HIBERNATION=n | ||
14 | CONFIG_PREEMPT_NONE=n | ||
15 | CONFIG_PREEMPT_VOLUNTARY=n | ||
16 | CONFIG_PREEMPT=y | ||
17 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
18 | CONFIG_RCU_TORTURE_TEST=m | ||
19 | CONFIG_MODULE_UNLOAD=y | ||
20 | CONFIG_PROVE_LOCKING=y | ||
21 | CONFIG_PROVE_RCU=y | ||
22 | CONFIG_DEBUG_KERNEL=y | ||
23 | CONFIG_DEBUG_OBJECTS=y | ||
24 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
25 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
26 | CONFIG_SLUB=y | ||
27 | CONFIG_IKCONFIG=y | ||
28 | CONFIG_IKCONFIG_PROC=y | ||
29 | CONFIG_PRINTK_TIME=y | ||
30 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-hp new file mode 100644 index 000000000000..588bc70420cd --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/P7-4-T-NH-SD-SMP-hp | |||
@@ -0,0 +1,30 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_SMP=y | ||
4 | CONFIG_RCU_FANOUT=2 | ||
5 | CONFIG_NR_CPUS=16 | ||
6 | CONFIG_RCU_FANOUT_EXACT=n | ||
7 | CONFIG_HOTPLUG_CPU=n | ||
8 | CONFIG_RCU_NOCB_CPU=y | ||
9 | CONFIG_RCU_NOCB_CPU_NONE=n | ||
10 | CONFIG_RCU_NOCB_CPU_ZERO=y | ||
11 | CONFIG_RCU_NOCB_CPU_ALL=n | ||
12 | CONFIG_SUSPEND=n | ||
13 | CONFIG_HIBERNATION=n | ||
14 | CONFIG_PREEMPT_NONE=n | ||
15 | CONFIG_PREEMPT_VOLUNTARY=n | ||
16 | CONFIG_PREEMPT=y | ||
17 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
18 | CONFIG_RCU_TORTURE_TEST=m | ||
19 | CONFIG_MODULE_UNLOAD=y | ||
20 | CONFIG_PROVE_LOCKING=y | ||
21 | CONFIG_PROVE_RCU=y | ||
22 | CONFIG_DEBUG_KERNEL=y | ||
23 | CONFIG_DEBUG_OBJECTS=y | ||
24 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
25 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
26 | CONFIG_SLUB=y | ||
27 | CONFIG_IKCONFIG=y | ||
28 | CONFIG_IKCONFIG_PROC=y | ||
29 | CONFIG_PRINTK_TIME=y | ||
30 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/PT1-nh b/tools/testing/selftests/rcutorture/configs/PT1-nh new file mode 100644 index 000000000000..e3361c3894a1 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/PT1-nh | |||
@@ -0,0 +1,23 @@ | |||
1 | CONFIG_TINY_PREEMPT_RCU=y | ||
2 | CONFIG_RCU_BOOST=y | ||
3 | CONFIG_RCU_BOOST_PRIO=2 | ||
4 | CONFIG_RCU_TRACE=y | ||
5 | CONFIG_RCU_TORTURE_TEST=m | ||
6 | CONFIG_MODULE_UNLOAD=y | ||
7 | CONFIG_SUSPEND=n | ||
8 | CONFIG_HIBERNATION=n | ||
9 | # | ||
10 | CONFIG_SMP=n | ||
11 | # | ||
12 | CONFIG_HOTPLUG_CPU=n | ||
13 | # | ||
14 | CONFIG_NO_HZ=n | ||
15 | # | ||
16 | CONFIG_PREEMPT_NONE=n | ||
17 | CONFIG_PREEMPT_VOLUNTARY=n | ||
18 | CONFIG_PREEMPT=y | ||
19 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
20 | CONFIG_IKCONFIG=y | ||
21 | CONFIG_IKCONFIG_PROC=y | ||
22 | CONFIG_PRINTK_TIME=y | ||
23 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/PT2-NH b/tools/testing/selftests/rcutorture/configs/PT2-NH new file mode 100644 index 000000000000..64abfc3b4d94 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/PT2-NH | |||
@@ -0,0 +1,22 @@ | |||
1 | CONFIG_TINY_PREEMPT_RCU=y | ||
2 | CONFIG_RCU_TORTURE_TEST=m | ||
3 | CONFIG_MODULE_UNLOAD=y | ||
4 | CONFIG_SUSPEND=n | ||
5 | CONFIG_HIBERNATION=n | ||
6 | # | ||
7 | CONFIG_SMP=n | ||
8 | # | ||
9 | CONFIG_HOTPLUG_CPU=n | ||
10 | # | ||
11 | CONFIG_NO_HZ=y | ||
12 | # | ||
13 | CONFIG_PREEMPT_NONE=n | ||
14 | CONFIG_PREEMPT_VOLUNTARY=n | ||
15 | CONFIG_PREEMPT=y | ||
16 | CONFIG_PROVE_LOCKING=y | ||
17 | CONFIG_PROVE_RCU=y | ||
18 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
19 | CONFIG_IKCONFIG=y | ||
20 | CONFIG_IKCONFIG_PROC=y | ||
21 | CONFIG_PRINTK_TIME=y | ||
22 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/sysidleN.2013.06.19a b/tools/testing/selftests/rcutorture/configs/sysidleN.2013.06.19a new file mode 100644 index 000000000000..9dbcde3a517e --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/sysidleN.2013.06.19a | |||
@@ -0,0 +1,23 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_RCU_CPU_STALL_INFO=y | ||
3 | CONFIG_NO_HZ_PERIODIC=n | ||
4 | CONFIG_NO_HZ_IDLE=n | ||
5 | CONFIG_NO_HZ_FULL=y | ||
6 | CONFIG_NO_HZ_FULL_SYSIDLE=n | ||
7 | CONFIG_RCU_FAST_NO_HZ=y | ||
8 | CONFIG_SMP=y | ||
9 | CONFIG_RCU_FANOUT=8 | ||
10 | CONFIG_NR_CPUS=8 | ||
11 | CONFIG_RCU_FANOUT_EXACT=n | ||
12 | CONFIG_HOTPLUG_CPU=y | ||
13 | CONFIG_PREEMPT_NONE=n | ||
14 | CONFIG_PREEMPT_VOLUNTARY=n | ||
15 | CONFIG_PREEMPT=y | ||
16 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
17 | CONFIG_RCU_TORTURE_TEST=m | ||
18 | CONFIG_MODULE_UNLOAD=y | ||
19 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
20 | CONFIG_IKCONFIG=y | ||
21 | CONFIG_IKCONFIG_PROC=y | ||
22 | CONFIG_PRINTK_TIME=y | ||
23 | |||
diff --git a/tools/testing/selftests/rcutorture/configs/sysidleY.2013.06.19a b/tools/testing/selftests/rcutorture/configs/sysidleY.2013.06.19a new file mode 100644 index 000000000000..d24dd6148ebf --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/sysidleY.2013.06.19a | |||
@@ -0,0 +1,26 @@ | |||
1 | CONFIG_RCU_TRACE=y | ||
2 | CONFIG_RCU_CPU_STALL_INFO=y | ||
3 | CONFIG_NO_HZ_PERIODIC=n | ||
4 | CONFIG_NO_HZ_IDLE=n | ||
5 | CONFIG_NO_HZ_FULL=y | ||
6 | CONFIG_NO_HZ_FULL_SYSIDLE=y | ||
7 | CONFIG_RCU_FAST_NO_HZ=y | ||
8 | CONFIG_SMP=y | ||
9 | CONFIG_RCU_FANOUT=8 | ||
10 | CONFIG_NR_CPUS=8 | ||
11 | CONFIG_RCU_FANOUT_EXACT=n | ||
12 | CONFIG_HOTPLUG_CPU=y | ||
13 | CONFIG_PREEMPT_NONE=n | ||
14 | CONFIG_PREEMPT_VOLUNTARY=n | ||
15 | CONFIG_PREEMPT=y | ||
16 | #CHECK#CONFIG_TREE_PREEMPT_RCU=y | ||
17 | CONFIG_RCU_TORTURE_TEST=m | ||
18 | CONFIG_MODULE_UNLOAD=y | ||
19 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
20 | CONFIG_IKCONFIG=y | ||
21 | CONFIG_IKCONFIG_PROC=y | ||
22 | CONFIG_PRINTK_TIME=y | ||
23 | |||
24 | CONFIG_PROVE_LOCKING=y | ||
25 | CONFIG_PROVE_RCU=y | ||
26 | |||
diff --git a/tools/testing/selftests/rcutorture/doc/initrd.txt b/tools/testing/selftests/rcutorture/doc/initrd.txt new file mode 100644 index 000000000000..49d134c25c04 --- /dev/null +++ b/tools/testing/selftests/rcutorture/doc/initrd.txt | |||
@@ -0,0 +1,90 @@ | |||
1 | This document describes one way to create the initrd directory hierarchy | ||
2 | in order to allow an initrd to be built into your kernel. The trick | ||
3 | here is to steal the initrd file used on your Linux laptop, Ubuntu in | ||
4 | this case. There are probably much better ways of doing this. | ||
5 | |||
6 | That said, here are the commands: | ||
7 | |||
8 | ------------------------------------------------------------------------ | ||
9 | zcat /initrd.img > /tmp/initrd.img.zcat | ||
10 | mkdir initrd | ||
11 | cd initrd | ||
12 | cpio -id < /tmp/initrd.img.zcat | ||
13 | ------------------------------------------------------------------------ | ||
14 | |||
15 | Interestingly enough, if you are running rcutorture, you don't really | ||
16 | need userspace in many cases. Running without userspace has the | ||
17 | advantage of allowing you to test your kernel independently of the | ||
18 | distro in place, the root-filesystem layout, and so on. To make this | ||
19 | happen, put the following script in the initrd's tree's "/init" file, | ||
20 | with 0755 mode. | ||
21 | |||
22 | ------------------------------------------------------------------------ | ||
23 | #!/bin/sh | ||
24 | |||
25 | [ -d /dev ] || mkdir -m 0755 /dev | ||
26 | [ -d /root ] || mkdir -m 0700 /root | ||
27 | [ -d /sys ] || mkdir /sys | ||
28 | [ -d /proc ] || mkdir /proc | ||
29 | [ -d /tmp ] || mkdir /tmp | ||
30 | mkdir -p /var/lock | ||
31 | mount -t sysfs -o nodev,noexec,nosuid sysfs /sys | ||
32 | mount -t proc -o nodev,noexec,nosuid proc /proc | ||
33 | # Some things don't work properly without /etc/mtab. | ||
34 | ln -sf /proc/mounts /etc/mtab | ||
35 | |||
36 | # Note that this only becomes /dev on the real filesystem if udev's scripts | ||
37 | # are used; which they will be, but it's worth pointing out | ||
38 | if ! mount -t devtmpfs -o mode=0755 udev /dev; then | ||
39 | echo "W: devtmpfs not available, falling back to tmpfs for /dev" | ||
40 | mount -t tmpfs -o mode=0755 udev /dev | ||
41 | [ -e /dev/console ] || mknod --mode=600 /dev/console c 5 1 | ||
42 | [ -e /dev/kmsg ] || mknod --mode=644 /dev/kmsg c 1 11 | ||
43 | [ -e /dev/null ] || mknod --mode=666 /dev/null c 1 3 | ||
44 | fi | ||
45 | |||
46 | mkdir /dev/pts | ||
47 | mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true | ||
48 | mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run | ||
49 | mkdir /run/initramfs | ||
50 | # compatibility symlink for the pre-oneiric locations | ||
51 | ln -s /run/initramfs /dev/.initramfs | ||
52 | |||
53 | # Export relevant variables | ||
54 | export ROOT= | ||
55 | export ROOTDELAY= | ||
56 | export ROOTFLAGS= | ||
57 | export ROOTFSTYPE= | ||
58 | export IP= | ||
59 | export BOOT= | ||
60 | export BOOTIF= | ||
61 | export UBIMTD= | ||
62 | export break= | ||
63 | export init=/sbin/init | ||
64 | export quiet=n | ||
65 | export readonly=y | ||
66 | export rootmnt=/root | ||
67 | export debug= | ||
68 | export panic= | ||
69 | export blacklist= | ||
70 | export resume= | ||
71 | export resume_offset= | ||
72 | export recovery= | ||
73 | |||
74 | for i in /sys/devices/system/cpu/cpu*/online | ||
75 | do | ||
76 | case $i in | ||
77 | '/sys/devices/system/cpu/cpu0/online') | ||
78 | ;; | ||
79 | '/sys/devices/system/cpu/cpu*/online') | ||
80 | ;; | ||
81 | *) | ||
82 | echo 1 > $i | ||
83 | ;; | ||
84 | esac | ||
85 | done | ||
86 | |||
87 | while : | ||
88 | do | ||
89 | sleep 10 | ||
90 | done | ||
diff --git a/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt b/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt new file mode 100644 index 000000000000..66efb59a1bd1 --- /dev/null +++ b/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | This document describes one way to created the rcu-test-image file | ||
2 | that contains the filesystem used by the guest-OS kernel. There are | ||
3 | probably much better ways of doing this, and this filesystem could no | ||
4 | doubt be smaller. It is probably also possible to simply download | ||
5 | an appropriate image from any number of places. | ||
6 | |||
7 | That said, here are the commands: | ||
8 | |||
9 | ------------------------------------------------------------------------ | ||
10 | dd if=/dev/zero of=rcu-test-image bs=400M count=1 | ||
11 | mkfs.ext3 ./rcu-test-image | ||
12 | sudo mount -o loop ./rcu-test-image /mnt | ||
13 | |||
14 | # Replace "precise" below with your favorite Ubuntu release. | ||
15 | # Empirical evidence says this image will work for 64-bit, but... | ||
16 | # Note that debootstrap does take a few minutes to run. Or longer. | ||
17 | sudo debootstrap --verbose --arch i386 precise /mnt http://archive.ubuntu.com/ubuntu | ||
18 | cat << '___EOF___' | sudo dd of=/mnt/etc/fstab | ||
19 | # UNCONFIGURED FSTAB FOR BASE SYSTEM | ||
20 | # | ||
21 | /dev/vda / ext3 defaults 1 1 | ||
22 | dev /dev tmpfs rw 0 0 | ||
23 | tmpfs /dev/shm tmpfs defaults 0 0 | ||
24 | devpts /dev/pts devpts gid=5,mode=620 0 0 | ||
25 | sysfs /sys sysfs defaults 0 0 | ||
26 | proc /proc proc defaults 0 0 | ||
27 | ___EOF___ | ||
28 | sudo umount /mnt | ||
29 | ------------------------------------------------------------------------ | ||
30 | |||
31 | |||
32 | References: | ||
33 | |||
34 | http://sripathikodi.blogspot.com/2010/02/creating-kvm-bootable-fedora-system.html | ||
35 | https://help.ubuntu.com/community/KVM/CreateGuests | ||
36 | https://help.ubuntu.com/community/JeOSVMBuilder | ||
37 | http://wiki.libvirt.org/page/UbuntuKVMWalkthrough | ||
38 | http://www.moe.co.uk/2011/01/07/pci_add_option_rom-failed-to-find-romfile-pxe-rtl8139-bin/ -- "apt-get install kvm-pxe" | ||
39 | http://www.landley.net/writing/rootfs-howto.html | ||
40 | http://en.wikipedia.org/wiki/Initrd | ||
41 | http://en.wikipedia.org/wiki/Cpio | ||
42 | http://wiki.libvirt.org/page/UbuntuKVMWalkthrough | ||