Lines Matching +full:a +full:- +full:9
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
24 LANG=en_US.UTF-8; export LANG
56 ds=`date +%Y.%m.%d-%H.%M.%S`
57 jitter="-1"
64 echo " --allcpus"
65 echo " --bootargs kernel-boot-arguments"
66 echo " --bootimage relative-path-to-kernel-boot-image"
67 echo " --buildonly"
68 echo " --configs \"config-file list w/ repeat factor (3*TINY01)\""
69 echo " --cpus N"
70 echo " --datestamp string"
71 echo " --defconfig string"
72 echo " --dryrun batches|scenarios|sched|script"
73 echo " --duration minutes | <seconds>s | <hours>h | <days>d"
74 echo " --gdb"
75 echo " --help"
76 echo " --interactive"
77 echo " --jitter N [ maxsleep (us) [ maxspin (us) ] ]"
78 echo " --kasan"
79 echo " --kconfig Kconfig-options"
80 echo " --kcsan"
81 echo " --kmake-arg kernel-make-arguments"
82 echo " --mac nn:nn:nn:nn:nn:nn"
83 echo " --memory megabytes|nnnG"
84 echo " --no-initrd"
85 echo " --qemu-args qemu-arguments"
86 echo " --qemu-cmd qemu-system-..."
87 echo " --remote"
88 echo " --results absolute-pathname"
89 echo " --shutdown-grace seconds"
90 echo " --torture lock|rcu|rcuscale|refscale|scf|X*"
91 echo " --trust-make"
95 while test $# -gt 0
98 --allcpus)
102 --bootargs|--bootarg)
103 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
107 --bootimage)
108 …checkarg --bootimage "(relative path to kernel boot image)" "$#" "$2" '[a-zA-Z0-9][a-zA-Z0-9_]*' '…
112 --buildonly|--build-only)
115 --configs|--config)
116 checkarg --configs "(list of config files)" "$#" "$2" '^[^/.a-z]\+$' '^--'
120 --cpus)
121 checkarg --cpus "(number)" "$#" "$2" '^[0-9]*$' '^--'
124 if test -z "$TORTURE_REMOTE"
127 if test "$TORTURE_ALLOTED_CPUS" -gt "$max_cpus"
134 --datestamp)
135 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[a-zA-Z0-9._/-]*$' '^--'
139 --defconfig)
140 checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
144 --dryrun)
145 checkarg --dryrun "batches|sched|script" $# "$2" 'batches\|scenarios\|sched\|script' '^--'
149 --duration)
150 checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(s\|m\|h\|d\|\)$' '^error'
152 if echo "$2" | grep -q 's$'
155 elif echo "$2" | grep -q 'h$'
158 elif echo "$2" | grep -q 'd$'
162 ts=`echo $2 | sed -e 's/[smhd]$//'`
166 --gdb)
169 TORTURE_QEMU_GDB_ARG="-s -S"; export TORTURE_QEMU_GDB_ARG
171 --help|-h)
174 --interactive)
177 --jitter)
178 …checkarg --jitter "(# threads [ sleep [ spin ] ])" $# "$2" '^-\{,1\}[0-9]\+\( \+[0-9]\+\)\{,2\} *$…
182 --kasan)
184 if test -n "$torture_qemu_mem_default"
189 --kconfig|--kconfigs)
190 …checkarg --kconfig "(Kconfig options)" $# "$2" '^CONFIG_[A-Z0-9_]\+=\([ynm]\|[0-9]\+\)\( CONFIG_[A…
191 TORTURE_KCONFIG_ARG="`echo "$TORTURE_KCONFIG_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
194 --kcsan)
197 --kmake-arg|--kmake-args)
198 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
199 TORTURE_KMAKE_ARG="`echo "$TORTURE_KMAKE_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
202 --mac)
203 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
207 --memory)
208 checkarg --memory "(memory size)" $# "$2" '^[0-9]\+[MG]\?$' error
213 --no-initrd)
216 --qemu-args|--qemu-arg)
217 checkarg --qemu-args "(qemu arguments)" $# "$2" '^-' '^error'
218 TORTURE_QEMU_ARG="`echo "$TORTURE_QEMU_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
221 --qemu-cmd)
222 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
226 --remote)
229 --results)
230 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
234 --shutdown-grace)
235 checkarg --shutdown-grace "(seconds)" "$#" "$2" '^[0-9]*$' '^error'
239 --torture)
240 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuscale\|refscale\|scf\|X.*\)$' '^--'
242 TORTURE_MOD="`echo $TORTURE_SUITE | sed -e 's/^\(lock\|rcu\|scf\)$/\1torture/'`"
252 --trust-make)
263 if test -n "$dryrun" || test -z "$TORTURE_INITRD" || tools/testing/selftests/rcutorture/bin/mkinitr…
274 if test -z "$configs"
279 if test -z "$resdir"
284 # Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
289 [0-9]\**|[0-9][0-9]\**|[0-9][0-9][0-9]\**|[0-9][0-9][0-9][0-9]\**)
290 config_reps=`echo $CF | sed -e 's/\*.*$//'`
291 CF1=`echo $CF | sed -e 's/^[^*]*\*//'`
304 configs_derep="`echo $configs_derep | sed -e "s/\<CFLIST\>/$defaultconfigs/g"`"
305 if test -n "$TORTURE_KCONFIG_GDB_ARG"
307 if test "`echo $configs_derep | wc -w`" -gt 1
309 echo "The --config list is: $configs_derep."
310 echo "Only one --config permitted with --gdb, terminating."
315 for CF1 in `echo $configs_derep | tr -s ' ' '\012' | sort -u`
317 if test -f "$CONFIGFRAG/$CF1"
319 if echo "$TORTURE_KCONFIG_ARG" | grep -q '\<CONFIG_NR_CPUS='
321 echo "$TORTURE_KCONFIG_ARG" | tr -s ' ' | tr ' ' '\012' > $T/KCONFIG_ARG
330 echo "The --configs file $CF1 does not exist, terminating."
341 echo $configs_derep | awk -f $T/cfgcpu.awk > $T/cfgcpu
342 sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
344 # Use a greedy bin-packing algorithm, sorting the list accordingly.
345 awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '
359 nc = -1;
362 # can be executed concurrently given ncpus. Note that a given test
373 continue; # Already part of a batch.
378 nc -= cpus[i];
380 break; # Too-big test in its own batch.
392 # Generate a script to execute the tests in appropriate batches.
417 if ! test -e $resdir
419 mkdir -p "$resdir" || :
421 mkdir -p $resdir/$ds
430 if test -d .git
432 echo Current commit: `git rev-parse HEAD` >> $resdir/$ds/testid.txt
434 echo ' ---' Output of "'"git status"'": >> $resdir/$ds/testid.txt
438 echo ' ---' Output of "'"git diff HEAD"'": >> $resdir/$ds/testid.txt
442 kvm-assign-cpus.sh /sys/devices/system/node > $T/cpuarray.awk
443 kvm-get-cpus-script.sh $T/cpuarray.awk $T/dumpbatches.awk
458 print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log";
463 if (ja[1] == -1 && ncpus == 0)
465 else if (ja[1] == -1)
482 ovf = "-ovf";
485 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log";
492 if (affinitylist ~ /^[0-9,-][0-9,-]*$/)
496 …print "kvm-test-1-run.sh " CONFIGDIR cf[j], rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE…
497 …print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
498 print "while test -f " builddir ".wait"
502 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
509 print "rm -f " builddir ".ready"
514 print "if test -f \"" rd cfr[j] "/builtkernel\""
516 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log";
522 print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
527 print "if test -n \"$needqemurun\""
529 print "\techo ---- Starting kernels. `date` | tee -a " rd "log";
536 print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log";
539 print "\techo ---- No kernel runs. `date` | tee -a " rd "log";
542 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log";
543 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log";
561 # Out of CPUs, dump out a batch.
568 nc -= cpus[i];
576 -v TORTURE_BUILDONLY="$TORTURE_BUILDONLY" \
577 -v CONFIGDIR="$CONFIGFRAG/" \
578 -v RCUTORTURE="$RCUTORTURE" \
579 -v ncpus=$cpus \
580 -v jitter="$jitter" \
581 -v rd=$resdir/$ds/ \
582 -v dur=$dur \
583 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
584 -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \
585 -f $T/dumpbatches.awk >> $T/script
586 echo kvm-end-run-stats.sh "$resdir/$ds" "$starttime" >> $T/script
589 egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
590 sed -e 's/:.*$//' -e 's/^echo //' -e 's/-ovf//' |
592 /^----Start/ {
601 grep -v '^#' $T/batches | awk '
626 egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
627 sed -e 's/:.*$//' -e 's/^echo //'
629 grep -v ">>" | sed -e 's/:.*$//' -e 's/^echo //' |
630 awk '{ print $1 }' | grep -v '\.' | wc -l`"
632 nbatches="`grep 'Start batch' $T/script | grep -v ">>" | wc -l`"
644 # Not a dryrun. Record the batches and the number of CPUs, then run the script.
654 # Function-graph tracing: ftrace=function_graph ftrace_graph_filter=sched_setaffinity,migration_cpu…
655 # Also --kconfig "CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y"
656 # Control buffer size: --bootargs trace_buf_size=3k
657 # Get trace-buffer dumps on all oopses: --bootargs ftrace_dump_on_oops
658 # Ditto, but dump only the oopsing CPU: --bootargs ftrace_dump_on_oops=orig_cpu
659 # Heavy-handed way to also dump on warnings: --bootargs panic_on_warn