kvm.sh (d3b1548aa247d7b436834dbe518189bb9c1ebd4b) kvm.sh (61010e74d76ca51dd452290d6c340c681df498ce)
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.

--- 27 unchanged lines hidden (view full) ---

36
37dur=30
38dryrun=""
39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
40PATH=${KVM}/bin:$PATH; export PATH
41builddir="${KVM}/b1"
42RCU_INITRD="$KVM/initrd"; export RCU_INITRD
43RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
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.

--- 27 unchanged lines hidden (view full) ---

36
37dur=30
38dryrun=""
39KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
40PATH=${KVM}/bin:$PATH; export PATH
41builddir="${KVM}/b1"
42RCU_INITRD="$KVM/initrd"; export RCU_INITRD
43RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
44TORTURE_SUITE=rcu
44resdir=""
45configs=""
46cpus=0
47ds=`date +%Y.%m.%d-%H:%M:%S`
48kversion=""
49
50. functions.sh
51

--- 9 unchanged lines hidden (view full) ---

61 echo " --duration minutes"
62 echo " --interactive"
63 echo " --kmake-arg kernel-make-arguments"
64 echo " --kversion vN.NN"
65 echo " --mac nn:nn:nn:nn:nn:nn"
66 echo " --no-initrd"
67 echo " --qemu-args qemu-system-..."
68 echo " --qemu-cmd qemu-system-..."
45resdir=""
46configs=""
47cpus=0
48ds=`date +%Y.%m.%d-%H:%M:%S`
49kversion=""
50
51. functions.sh
52

--- 9 unchanged lines hidden (view full) ---

62 echo " --duration minutes"
63 echo " --interactive"
64 echo " --kmake-arg kernel-make-arguments"
65 echo " --kversion vN.NN"
66 echo " --mac nn:nn:nn:nn:nn:nn"
67 echo " --no-initrd"
68 echo " --qemu-args qemu-system-..."
69 echo " --qemu-cmd qemu-system-..."
69 echo " --results absolute-pathname"
70 echo " --relbuilddir relative-pathname"
70 echo " --relbuilddir relative-pathname"
71 echo " --results absolute-pathname"
72 echo " --torture rcu"
71 exit 1
72}
73
74while test $# -gt 0
75do
76 case "$1" in
77 --bootargs)
78 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'

--- 72 unchanged lines hidden (view full) ---

151 builddir=${KVM}/${relbuilddir}
152 shift
153 ;;
154 --results)
155 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
156 resdir=$2
157 shift
158 ;;
73 exit 1
74}
75
76while test $# -gt 0
77do
78 case "$1" in
79 --bootargs)
80 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'

--- 72 unchanged lines hidden (view full) ---

153 builddir=${KVM}/${relbuilddir}
154 shift
155 ;;
156 --results)
157 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
158 resdir=$2
159 shift
160 ;;
161 --torture)
162 checkarg --torture "(suite name)" "$#" "$2" '^rcu$' '^--'
163 TORTURE_SUITE=$2
164 shift
165 ;;
159 *)
160 echo Unknown argument $1
161 usage
162 ;;
163 esac
164 shift
165done
166
166 *)
167 echo Unknown argument $1
168 usage
169 ;;
170 esac
171 shift
172done
173
167CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
174CONFIGFRAG=${KVM}/configs/${TORTURE_SUITE}; export CONFIGFRAG
168KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
169
170if test -z "$configs"
171then
172 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
173fi
174
175if test -z "$resdir"

--- 10 unchanged lines hidden (view full) ---

186 mkdir $resdir/$ds
187
188 # Be noisy only if running the script.
189 echo Results directory: $resdir/$ds
190 echo $scriptname $args
191
192 touch $resdir/$ds/log
193 echo $scriptname $args >> $resdir/$ds/log
175KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
176
177if test -z "$configs"
178then
179 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
180fi
181
182if test -z "$resdir"

--- 10 unchanged lines hidden (view full) ---

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
194
195 pwd > $resdir/$ds/testid.txt
196 if test -d .git
197 then
198 git status >> $resdir/$ds/testid.txt
199 git rev-parse HEAD >> $resdir/$ds/testid.txt
200 fi
201fi

--- 58 unchanged lines hidden (view full) ---

260 # Dump out the tests in batch order.
261 for (b = 1; b <= batch; b++)
262 for (i = 0; i < njobs; i++)
263 if (done[i] == b)
264 print cf[i], cpus[i];
265}'
266
267# Generate a script to execute the tests in appropriate batches.
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

--- 58 unchanged lines hidden (view full) ---

268 # Dump out the tests in batch order.
269 for (b = 1; b <= batch; b++)
270 for (i = 0; i < njobs; i++)
271 if (done[i] == b)
272 print cf[i], cpus[i];
273}'
274
275# Generate a script to execute the tests in appropriate batches.
276cat << ___EOF___ > $T/script
277TORTURE_SUITE="$TORTURE_SUITE"; export TORTURE_SUITE
278___EOF___
268awk < $T/cfgcpu.pack \
269 -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
270 -v KVM="$KVM" \
271 -v ncpus=$cpus \
272 -v rd=$resdir/$ds/ \
273 -v dur=$dur \
274 -v RCU_QEMU_ARG=$RCU_QEMU_ARG \
275 -v RCU_BOOTARGS=$RCU_BOOTARGS \

--- 72 unchanged lines hidden (view full) ---

348 nc = ncpus;
349 }
350 # Account for the CPUs needed by the current test.
351 nc -= cpus[i];
352 }
353 # Dump the last batch.
354 if (ncpus != 0)
355 dump(first, i);
279awk < $T/cfgcpu.pack \
280 -v CONFIGDIR="$CONFIGFRAG/$kversion/" \
281 -v KVM="$KVM" \
282 -v ncpus=$cpus \
283 -v rd=$resdir/$ds/ \
284 -v dur=$dur \
285 -v RCU_QEMU_ARG=$RCU_QEMU_ARG \
286 -v RCU_BOOTARGS=$RCU_BOOTARGS \

--- 72 unchanged lines hidden (view full) ---

359 nc = ncpus;
360 }
361 # Account for the CPUs needed by the current test.
362 nc -= cpus[i];
363 }
364 # Dump the last batch.
365 if (ncpus != 0)
366 dump(first, i);
356}' > $T/script
367}' >> $T/script
357
358if test "$dryrun" = script
359then
360 # Dump out the script, but define the environment variables that
361 # it needs to run standalone.
362 echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
363 echo KVM="$KVM; export KVM"
364 echo KVPATH="$KVPATH; export KVPATH"

--- 29 unchanged lines hidden ---
368
369if test "$dryrun" = script
370then
371 # Dump out the script, but define the environment variables that
372 # it needs to run standalone.
373 echo CONFIGFRAG="$CONFIGFRAG; export CONFIGFRAG"
374 echo KVM="$KVM; export KVM"
375 echo KVPATH="$KVPATH; export KVPATH"

--- 29 unchanged lines hidden ---