Lines Matching +full:a +full:- +full:za +full:- +full:z

2 # SPDX-License-Identifier: GPL-2.0+
4 # Run a series of tests under KVM. By default, this series is specified
5 # by the relevant CFLIST file, but can be overridden by the --configs
6 # command-line argument.
17 T=${TMPDIR-/tmp}/kvm.sh.$$
18 trap 'rm -rf $T' 0
47 ds=`date +%Y.%m.%d-%H.%M.%S`
48 jitter="-1"
52 echo " --allcpus"
53 echo " --bootargs kernel-boot-arguments"
54 echo " --bootimage relative-path-to-kernel-boot-image"
55 echo " --buildonly"
56 echo " --configs \"config-file list w/ repeat factor (3*TINY01)\""
57 echo " --cpus N"
58 echo " --datestamp string"
59 echo " --defconfig string"
60 echo " --dryrun sched|script"
61 echo " --duration minutes"
62 echo " --gdb"
63 echo " --help"
64 echo " --interactive"
65 echo " --jitter N [ maxsleep (us) [ maxspin (us) ] ]"
66 echo " --kconfig Kconfig-options"
67 echo " --kmake-arg kernel-make-arguments"
68 echo " --mac nn:nn:nn:nn:nn:nn"
69 echo " --memory megabytes|nnnG"
70 echo " --no-initrd"
71 echo " --qemu-args qemu-arguments"
72 echo " --qemu-cmd qemu-system-..."
73 echo " --results absolute-pathname"
74 echo " --torture lock|rcu|rcuscale|refscale|scf"
75 echo " --trust-make"
79 while test $# -gt 0
82 --allcpus)
86 --bootargs|--bootarg)
87 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
91 --bootimage)
92 …checkarg --bootimage "(relative path to kernel boot image)" "$#" "$2" '[a-zA-Z0-9][a-zA-Z0-9_]*' '…
96 --buildonly)
99 --configs|--config)
100 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
104 --cpus)
105 checkarg --cpus "(number)" "$#" "$2" '^[0-9]*$' '^--'
109 if test "$TORTURE_ALLOTED_CPUS" -gt "$max_cpus"
115 --datestamp)
116 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
120 --defconfig)
121 checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
125 --dryrun)
126 checkarg --dryrun "sched|script" $# "$2" 'sched\|script' '^--'
130 --duration)
131 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
135 --gdb)
138 TORTURE_QEMU_GDB_ARG="-s -S"; export TORTURE_QEMU_GDB_ARG
140 --help|-h)
143 --interactive)
146 --jitter)
147 …checkarg --jitter "(# threads [ sleep [ spin ] ])" $# "$2" '^-\{,1\}[0-9]\+\( \+[0-9]\+\)\{,2\} *$…
151 --kconfig)
152 …checkarg --kconfig "(Kconfig options)" $# "$2" '^CONFIG_[A-Z0-9_]\+=\([ynm]\|[0-9]\+\)\( CONFIG_[A…
156 --kasan)
159 --kcsan)
162 --kmake-arg)
163 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
167 --mac)
168 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
172 --memory)
173 checkarg --memory "(memory size)" $# "$2" '^[0-9]\+[MG]\?$' error
177 --no-initrd)
180 --qemu-args|--qemu-arg)
181 checkarg --qemu-args "(qemu arguments)" $# "$2" '^-' '^error'
185 --qemu-cmd)
186 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
190 --results)
191 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
195 --shutdown-grace)
196 checkarg --shutdown-grace "(seconds)" "$#" "$2" '^[0-9]*$' '^error'
200 --torture)
201 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuscale\|refscale\|scf\)$' '^--'
212 --trust-make)
223 if test -z "$TORTURE_INITRD" || tools/testing/selftests/rcutorture/bin/mkinitrd.sh
234 if test -z "$configs"
239 if test -z "$resdir"
244 # Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
249 [0-9]\**|[0-9][0-9]\**|[0-9][0-9][0-9]\**)
250 config_reps=`echo $CF | sed -e 's/\*.*$//'`
251 CF1=`echo $CF | sed -e 's/^[^*]*\*//'`
264 configs_derep="`echo $configs_derep | sed -e "s/\<CFLIST\>/$defaultconfigs/g"`"
265 if test -n "$TORTURE_KCONFIG_GDB_ARG"
267 if test "`echo $configs_derep | wc -w`" -gt 1
269 echo "The --config list is: $configs_derep."
270 echo "Only one --config permitted with --gdb, terminating."
276 if test -f "$CONFIGFRAG/$CF1"
283 echo "The --configs file $CF1 does not exist, terminating."
287 sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
289 # Use a greedy bin-packing algorithm, sorting the list accordingly.
290 awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '
304 nc = -1;
307 # that can be executed concurrently given ncpus. Note that a
319 continue; # Already part of a batch.
324 nc -= cpus[i];
326 break; # Too-big test in its own batch.
338 # Generate a script to execute the tests in appropriate batches.
362 if ! test -e $resdir
364 mkdir -p "$resdir" || :
375 if test -d .git
378 git rev-parse HEAD >> $resdir/$ds/testid.txt
383 -v TORTURE_BUILDONLY="$TORTURE_BUILDONLY" \
384 -v CONFIGDIR="$CONFIGFRAG/" \
385 -v KVM="$KVM" \
386 -v ncpus=$cpus \
387 -v jitter="$jitter" \
388 -v rd=$resdir/$ds/ \
389 -v dur=$dur \
390 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
391 -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \
405 print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log";
409 builddir=KVM "/b" j - first + 1
419 ovf = "-ovf";
422 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log";
423 print "rm -f " builddir ".*";
426 …t "kvm-test-1-run.sh " CONFIGDIR cf[j], builddir, rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" T…
427 …print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
428 print "while test -f " builddir ".wait"
432 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
437 print "rm -f " builddir ".ready"
438 print "if test -f \"" rd cfr[j] "/builtkernel\""
440 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log";
446 if (ja[1] == -1 && ncpus == 0)
448 else if (ja[1] == -1)
454 print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
459 print "if test -n \"$needqemurun\""
461 print "\techo ---- Starting kernels. `date` | tee -a " rd "log";
465 print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log";
468 print "\techo ---- No kernel runs. `date` | tee -a " rd "log";
472 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log";
473 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log";
491 # Out of CPUs, dump out a batch.
498 nc -= cpus[i];
508 echo " --- `date` Test summary:"
510 kcsan-collapse.sh $resdir/$ds
511 kvm-recheck.sh $resdir/$ds
522 grep -v ">>" |
523 sed -e 's/:.*$//' -e 's/^echo //'
526 # Not a dryrun, so run the script.
531 # Function-graph tracing: ftrace=function_graph ftrace_graph_filter=sched_setaffinity,migration_cpu…
532 # Also --kconfig "CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y"
533 # Control buffer size: --bootargs trace_buf_size=3k
534 # Get trace-buffer dumps on all oopses: --bootargs ftrace_dump_on_oops
535 # Ditto, but dump only the oopsing CPU: --bootargs ftrace_dump_on_oops=orig_cpu
536 # Heavy-handed way to also dump on warnings: --bootargs panic_on_warn