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, write to the Free Software
24 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
36 RCU_INITRD="$KVM/initrd"; export RCU_INITRD
37 RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
40 ds=`date +%Y.%m.%d-%H:%M:%S`
44 echo "Usage: $scriptname optional arguments:"
45 echo " --bootargs kernel-boot-arguments"
46 echo " --builddir absolute-pathname"
48 echo " --configs \"config-file list\""
49 echo " --datestamp string"
50 echo " --duration minutes"
52 echo " --kmake-arg kernel-make-arguments"
53 echo " --kversion vN.NN"
54 echo " --mac nn:nn:nn:nn:nn:nn"
56 echo " --qemu-args qemu-system-..."
57 echo " --qemu-cmd qemu-system-..."
58 echo " --results absolute-pathname"
59 echo " --relbuilddir relative-pathname"
63 # checkarg --argname argtype $# arg mustmatch cannotmatch
67 echo $1 needs argument $2 matching \"$5\"
70 if echo "$4" | grep -q -e "$5"
74 echo $1 $2 \"$4\" must match \"$5\"
77 if echo "$4" | grep -q -e "$6"
79 echo $1 $2 \"$4\" must not match \"$6\"
88 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
93 checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' '^error'
99 RCU_BUILDONLY=1; export RCU_BUILDONLY
102 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
107 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
112 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
117 RCU_QEMU_INTERACTIVE=1; export RCU_QEMU_INTERACTIVE
120 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
121 RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
125 checkarg --kversion "(kernel version)" $# "$2" '^v[0-9.]*$' '^error'
130 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
131 RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
135 RCU_INITRD=""; export RCU_INITRD
138 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
143 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
144 RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD
148 checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
151 builddir=${KVM}/${relbuilddir}
155 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
160 echo Unknown argument $1
167 PATH=${KVM}/bin:$PATH; export PATH
168 CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
169 KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
171 if test -z "$configs"
173 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
186 mkdir -p "$resdir" || :
190 touch $resdir/$ds/log
191 echo $scriptname $args >> $resdir/$ds/log
193 pwd > $resdir/$ds/testid.txt
196 git status >> $resdir/$ds/testid.txt
197 git rev-parse HEAD >> $resdir/$ds/testid.txt
200 if ! test -e $builddir
209 echo Results directory: $rd
210 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic $RCU_QEMU_ARG" "rcutorture.test_no_idle_hz=1 rcutorture.verbose=1 $RCU_BOOTARGS"
212 # 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