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.
7 # Edit the definitions below to set the locations of the various directories,
8 # as well as the test duration.
10 # Usage: sh kvm.sh [ options ]
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.
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.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, you can access it online at
24 # http://www.gnu.org/licenses/gpl-2.0.html.
26 # Copyright (C) IBM Corporation, 2011
28 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
34 KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
35 PATH=${KVM}/bin:$PATH; export PATH
37 RCU_INITRD="$KVM/initrd"; export RCU_INITRD
38 RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
41 ds=`date +%Y.%m.%d-%H:%M:%S`
47 echo "Usage: $scriptname optional arguments:"
48 echo " --bootargs kernel-boot-arguments"
49 echo " --builddir absolute-pathname"
51 echo " --configs \"config-file list\""
52 echo " --datestamp string"
53 echo " --duration minutes"
55 echo " --kmake-arg kernel-make-arguments"
56 echo " --kversion vN.NN"
57 echo " --mac nn:nn:nn:nn:nn:nn"
59 echo " --qemu-args qemu-system-..."
60 echo " --qemu-cmd qemu-system-..."
61 echo " --results absolute-pathname"
62 echo " --relbuilddir relative-pathname"
70 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
75 checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' '^error'
81 RCU_BUILDONLY=1; export RCU_BUILDONLY
84 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
89 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
94 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
99 RCU_QEMU_INTERACTIVE=1; export RCU_QEMU_INTERACTIVE
102 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
103 RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
107 checkarg --kversion "(kernel version)" $# "$2" '^v[0-9.]*$' '^error'
112 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
113 RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
117 RCU_INITRD=""; export RCU_INITRD
120 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
125 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
126 RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD
130 checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
133 builddir=${KVM}/${relbuilddir}
137 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
142 echo Unknown argument $1
149 CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
150 KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
152 if test -z "$configs"
154 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
167 mkdir -p "$resdir" || :
171 touch $resdir/$ds/log
172 echo $scriptname $args
173 echo $scriptname $args >> $resdir/$ds/log
175 pwd > $resdir/$ds/testid.txt
178 git status >> $resdir/$ds/testid.txt
179 git rev-parse HEAD >> $resdir/$ds/testid.txt
182 if ! test -e $builddir
189 # Running TREE01 multiple times creates TREE01, TREE01.2, TREE01.3, ...
193 n="`ls -d "${rd}"* | grep '\.[0-9]\+$' |
194 sed -e 's/^.*\.\([0-9]\+\)/\1/' |
195 sort -k1n | tail -1`"
205 echo Results directory: $rd
206 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "$RCU_QEMU_ARG" "$RCU_BOOTARGS"
208 # 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
210 echo " --- `date` Test summary:"
211 kvm-recheck.sh $resdir/$ds