Lines Matching +full:ts +full:- +full:series
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="`mktemp -d ${TMPDIR-/tmp}/kvm.sh.XXXXXX`"
18 trap 'rm -rf $T' 0
23 LANG=en_US.UTF-8; export LANG
57 ds=`date +%Y.%m.%d-%H.%M.%S`
58 jitter="-1"
65 echo " --allcpus"
66 echo " --bootargs kernel-boot-arguments"
67 echo " --bootimage relative-path-to-kernel-boot-image"
68 echo " --buildonly"
69 echo " --configs \"config-file list w/ repeat factor (3*TINY01)\""
70 echo " --cpus N"
71 echo " --datestamp string"
72 echo " --defconfig string"
73 echo " --debug-info"
74 echo " --dryrun batches|scenarios|sched|script"
75 echo " --duration minutes | <seconds>s | <hours>h | <days>d"
76 echo " --gdb"
77 echo " --help"
78 echo " --interactive"
79 echo " --jitter N [ maxsleep (us) [ maxspin (us) ] ]"
80 echo " --kasan"
81 echo " --kconfig Kconfig-options"
82 echo " --kcsan"
83 echo " --kmake-arg kernel-make-arguments"
84 echo " --mac nn:nn:nn:nn:nn:nn"
85 echo " --memory megabytes|nnnG"
86 echo " --no-affinity"
87 echo " --no-initrd"
88 echo " --qemu-args qemu-arguments"
89 echo " --qemu-cmd qemu-system-..."
90 echo " --remote"
91 echo " --results absolute-pathname"
92 echo " --shutdown-grace seconds"
93 echo " --torture lock|rcu|rcuscale|refscale|scf|X*"
94 echo " --trust-make"
98 while test $# -gt 0
101 --allcpus)
105 --bootargs|--bootarg)
106 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
110 --bootimage)
111 …checkarg --bootimage "(relative path to kernel boot image)" "$#" "$2" '[a-zA-Z0-9][a-zA-Z0-9_]*' '…
115 --buildonly|--build-only)
118 --configs|--config)
119 checkarg --configs "(list of config files)" "$#" "$2" '^[^/.a-z]\+$' '^--'
123 --cpus)
124 checkarg --cpus "(number)" "$#" "$2" '^[0-9]*$' '^--'
127 if test -z "$TORTURE_REMOTE"
130 if test "$TORTURE_ALLOTED_CPUS" -gt "$max_cpus"
137 --datestamp)
138 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[a-zA-Z0-9._/-]*$' '^--'
142 --debug-info|--debuginfo)
143 if test -z "$TORTURE_KCONFIG_KCSAN_ARG" && test -z "$TORTURE_BOOT_GDB_ARG"
148 echo "Ignored redundant --debug-info (implied by --kcsan &c)"
151 --defconfig)
152 checkarg --defconfig "defconfigtype" "$#" "$2" '^[^/][^/]*$' '^--'
156 --dryrun)
157 checkarg --dryrun "batches|sched|script" $# "$2" 'batches\|scenarios\|sched\|script' '^--'
161 --duration)
162 checkarg --duration "(minutes)" $# "$2" '^[0-9][0-9]*\(s\|m\|h\|d\|\)$' '^error'
164 if echo "$2" | grep -q 's$'
167 elif echo "$2" | grep -q 'h$'
170 elif echo "$2" | grep -q 'd$'
174 ts=`echo $2 | sed -e 's/[smhd]$//'`
175 dur=$(($ts*mult))
178 --gdb)
181 TORTURE_QEMU_GDB_ARG="-s -S"; export TORTURE_QEMU_GDB_ARG
183 --help|-h)
186 --interactive)
189 --jitter)
190 …checkarg --jitter "(# threads [ sleep [ spin ] ])" $# "$2" '^-\{,1\}[0-9]\+\( \+[0-9]\+\)\{,2\} *$…
194 --kasan)
196 if test -n "$torture_qemu_mem_default"
201 --kconfig|--kconfigs)
202 …rg --kconfig "(Kconfig options)" $# "$2" '^\(#CHECK#\)\?CONFIG_[A-Z0-9_]\+=\([ynm]\|[0-9]\+\|"[^"]…
203 TORTURE_KCONFIG_ARG="`echo "$TORTURE_KCONFIG_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
206 --kcsan)
209 --kmake-arg|--kmake-args)
210 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
211 TORTURE_KMAKE_ARG="`echo "$TORTURE_KMAKE_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
214 --mac)
215 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
219 --memory)
220 checkarg --memory "(memory size)" $# "$2" '^[0-9]\+[MG]\?$' error
225 --no-affinity)
226 TORTURE_NO_AFFINITY="no-affinity"
228 --no-initrd)
231 --qemu-args|--qemu-arg)
232 checkarg --qemu-args "(qemu arguments)" $# "$2" '^-' '^error'
233 TORTURE_QEMU_ARG="`echo "$TORTURE_QEMU_ARG $2" | sed -e 's/^ *//' -e 's/ *$//'`"
236 --qemu-cmd)
237 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
241 --remote)
244 --results)
245 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
249 --shutdown-grace)
250 checkarg --shutdown-grace "(seconds)" "$#" "$2" '^[0-9]*$' '^error'
254 --torture)
255 checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuscale\|refscale\|scf\|X.*\)$' '^--'
257 TORTURE_MOD="`echo $TORTURE_SUITE | sed -e 's/^\(lock\|rcu\|scf\)$/\1torture/'`"
267 --trust-make)
278 if test -n "$dryrun" || test -z "$TORTURE_INITRD" || tools/testing/selftests/rcutorture/bin/mkinitr…
289 if test -z "$configs"
294 if test -z "$resdir"
299 # Create a file of test-name/#cpus pairs, sorted by decreasing #cpus.
304 [0-9]\**|[0-9][0-9]\**|[0-9][0-9][0-9]\**|[0-9][0-9][0-9][0-9]\**)
305 config_reps=`echo $CF | sed -e 's/\*.*$//'`
306 CF1=`echo $CF | sed -e 's/^[^*]*\*//'`
319 configs_derep="`echo $configs_derep | sed -e "s/\<CFLIST\>/$defaultconfigs/g"`"
320 if test -n "$TORTURE_KCONFIG_GDB_ARG"
322 if test "`echo $configs_derep | wc -w`" -gt 1
324 echo "The --config list is: $configs_derep."
325 echo "Only one --config permitted with --gdb, terminating."
330 for CF1 in `echo $configs_derep | tr -s ' ' '\012' | sort -u`
332 if test -f "$CONFIGFRAG/$CF1"
334 if echo "$TORTURE_KCONFIG_ARG" | grep -q '\<CONFIG_NR_CPUS='
336 echo "$TORTURE_KCONFIG_ARG" | tr -s ' ' | tr ' ' '\012' > $T/KCONFIG_ARG
345 echo "The --configs file $CF1 does not exist, terminating."
356 echo $configs_derep | awk -f $T/cfgcpu.awk > $T/cfgcpu
357 sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
359 # Use a greedy bin-packing algorithm, sorting the list accordingly.
360 awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '
374 nc = -1;
393 nc -= cpus[i];
395 break; # Too-big test in its own batch.
433 if ! test -e $resdir
435 mkdir -p "$resdir" || :
437 mkdir -p $resdir/$ds
446 if test -d .git
448 echo Current commit: `git rev-parse HEAD` >> $resdir/$ds/testid.txt
450 echo ' ---' Output of "'"git status"'": >> $resdir/$ds/testid.txt
454 echo ' ---' Output of "'"git diff HEAD"'": >> $resdir/$ds/testid.txt
458 kvm-assign-cpus.sh /sys/devices/system/node > $T/cpuarray.awk
459 kvm-get-cpus-script.sh $T/cpuarray.awk $T/dumpbatches.awk
474 print "echo ----Start batch " batchnum ": `date` | tee -a " rd "log";
479 if (ja[1] == -1 && ncpus == 0)
481 else if (ja[1] == -1)
498 ovf = "-ovf";
501 print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date` | tee -a " rd "log";
508 if (affinitylist ~ /^[0-9,-][0-9,-]*$/)
512 …print "kvm-test-1-run.sh " CONFIGDIR cf[j], rd cfr[jn], dur " \"" TORTURE_QEMU_ARG "\" \"" TORTURE…
513 …print "echo ", cfr[jn], cpusr[jn] ovf ": Waiting for build to complete. `date` | tee -a " rd "log";
514 print "while test -f " builddir ".wait"
518 print "echo ", cfr[jn], cpusr[jn] ovf ": Build complete. `date` | tee -a " rd "log";
525 print "rm -f " builddir ".ready"
530 print "if test -f \"" rd cfr[j] "/builtkernel\""
532 print "\techo ----", cfr[j], cpusr[j] ovf ": Kernel present. `date` | tee -a " rd "log";
538 print "echo Build-only run, so suppressing jitter | tee -a " rd "log"
543 print "if test -n \"$needqemurun\""
545 print "\techo ---- Starting kernels. `date` | tee -a " rd "log";
552 print "\techo ---- All kernel runs complete. `date` | tee -a " rd "log";
555 print "\techo ---- No kernel runs. `date` | tee -a " rd "log";
558 print "echo ----", cfr[j], cpusr[j] ovf ": Build/run results: | tee -a " rd "log";
559 print "cat " rd cfr[j] "/kvm-test-1-run.sh.out | tee -a " rd "log";
584 nc -= cpus[i];
592 -v TORTURE_BUILDONLY="$TORTURE_BUILDONLY" \
593 -v CONFIGDIR="$CONFIGFRAG/" \
594 -v RCUTORTURE="$RCUTORTURE" \
595 -v ncpus=$cpus \
596 -v jitter="$jitter" \
597 -v rd=$resdir/$ds/ \
598 -v dur=$dur \
599 -v TORTURE_QEMU_ARG="$TORTURE_QEMU_ARG" \
600 -v TORTURE_BOOTARGS="$TORTURE_BOOTARGS" \
601 -f $T/dumpbatches.awk >> $T/script
602 echo kvm-end-run-stats.sh "$resdir/$ds" "$starttime" >> $T/script
605 grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
606 sed -e 's/:.*$//' -e 's/^echo //' -e 's/-ovf//' |
608 /^----Start/ {
617 grep -v '^#' $T/batches | awk '
642 grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
643 sed -e 's/:.*$//' -e 's/^echo //'
645 grep -v ">>" | sed -e 's/:.*$//' -e 's/^echo //' |
646 awk '{ print $1 }' | grep -v '\.' | wc -l`"
648 nbatches="`grep 'Start batch' $T/script | grep -v ">>" | wc -l`"
670 # Function-graph tracing: ftrace=function_graph ftrace_graph_filter=sched_setaffinity,migration_cpu…
671 # Also --kconfig "CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y"
672 # Control buffer size: --bootargs trace_buf_size=3k
673 # Get trace-buffer dumps on all oopses: --bootargs ftrace_dump_on_oops
674 # Ditto, but dump only the oopsing CPU: --bootargs ftrace_dump_on_oops=orig_cpu
675 # Heavy-handed way to also dump on warnings: --bootargs panic_on_warn=1