aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-02-12Merge branch 'for-mingo-nolibc' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcuIngo Molnar1-1/+1
Pull nolibc fixes from Paul E. McKenney. Signed-off-by: Ingo Molnar <mingo@kernel.org>
2021-01-21tools/rcutorture: Fix position of -lgcc in mkinitrd.shWilly Tarreau1-1/+1
The -lgcc command-line argument is placed poorly in the build options, which can result in build failures, for exapmle, on ARM when uidiv() is required. This commit therefore places the -lgcc argument after the source files. Fixes: b94ec36896da ("rcutorture: Make use of nolibc when available") Tested-by: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64] Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Compress KASAN vmlinux filesPaul E. McKenney1-2/+46
The sizes of vmlinux files built with KASAN enabled can approach a full gigabyte, which can result in disk overflow sooner rather than later. Fortunately, the xz command compresses them by almost an order of magnitude. This commit therefore uses xz to compress vmlinux file built by torture.sh with KASAN enabled. However, xz is not the fastest thing in the world. In fact, it is way slower than rotating-rust mass storage. This commit therefore also adds a --compress-kasan-vmlinux argument to specify the degree of xz concurrency, which defaults to using all available CPUs if there are that many files in need of compression. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Add --kcsan-kmake-arg to torture.sh for KCSANPaul E. McKenney1-6/+15
In 2020, running KCSAN often requires careful choice of compiler. This commit therefore adds a --kcsan-kmake-arg parameter to torture.sh to allow specifying (for example) "CC=clang" to the kernel build process to correctly build a KCSAN-enabled kernel. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Add command and results directory to torture.sh logPaul E. McKenney1-4/+7
This commit adds the command and arguments to the torture.sh log file, and also outputs the results directory. This latter allows impatient users to quickly find the results that are being generated by the current run. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Allow scenarios to be specified to torture.shPaul E. McKenney1-3/+43
This commit adds --configs-rcutorture, --configs-locktorture, and --configs-scftorture arguments to torture.sh, allowing the desired set of scenarios to be passed to each. The default for each has been changed from a large-system-appropriate set to just CFLIST for each. Users are encouraged to create scripts that provide appropriate settings for their specific systems. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Drop log.long generation from torture.shPaul E. McKenney1-4/+1
Now that kvm.sh puts all the relevant details in the "log" file, there is no need for torture.sh to generate a separate "log.long" file. This commit therefore drops this from torture.sh. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh refuse to do zero-length runsPaul E. McKenney1-6/+19
This commit causes torture.sh to check for zero-length runs and to take the cowardly option of refusing to run them, logging its cowardice for later inspection. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh throttle VERBOSE_TOROUT_*() for refscalePaul E. McKenney1-1/+1
This commit causes torture.sh to use the torture.verbose_sleep_frequency kernel boot parameter to throttle verbose refscale output on large systems. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh allmodconfig retain and label outputPaul E. McKenney1-3/+6
This commit places "---" markers in the torture.sh script's allmodconfig output, and uses "<<" to avoid overwriting earlier output from this build test. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Create doyesno helper function for torture.shPaul E. McKenney1-59/+19
This commit saves a few lines of code by creating a doyesno helper bash function for argument parsing. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh refscale runs use verbose_batched module parameterPaul E. McKenney1-1/+6
On large systems, the refscale printk() rate can overrun the file system's ability to accept console log messages. This commit therefore uses the new verbose_batched module parameter to rate-limit some of the higher-rate printk() calls. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh rcuscale and refscale deal with allmodconfigPaul E. McKenney1-2/+2
The .mod.c files created by allmodconfig builds interfers with the approach torture.sh uses to enumerate types of rcuscale and refscale runs. This commit therefore tightens the pattern matching to avoid this interference. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Enable torture.sh argument checkingPaul E. McKenney1-5/+5
This commit uncomments the argument checking for the --duration argument to torture.sh. While in the area, it also corrects the duration units from seconds to minutes. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Auto-size SCF and scaling runs based on number of CPUsPaul E. McKenney1-7/+12
This commit improves torture.sh flexibility by autoscaling the number of CPUs to be used in variable-CPUs torture tests, including scftorture, refscale, rcuscale, and kvfree. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Add "make allmodconfig" to torture.shPaul E. McKenney1-1/+36
This commit adds the ability to do "make allmodconfig" to torture.sh, given that normal rcutorture runs do not normally catch missing exports. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Remove use of "eval" in torture.shPaul E. McKenney1-11/+44
The bash "eval" command enables Bobby Tables attacks, which might not be a concern in torture testing by themselves, but one could imagine these combined with a cut-and-paste attack. This commit therefore gets rid of them. This comes at a price in terms of bash quoting not working nicely, so the "--bootargs" argument lists are now passed to torture_one via a bash-variable side channel. This might be a bit ugly, but it will also allow torture.sh to grow its own --bootargs parameter. While in the area, add proper header comments for the bash functions. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Make torture.sh use common time-duration bash functionsPaul E. McKenney1-13/+7
This commit makes torture.sh use the new bash functions get_starttime() and get_starttime_duration() created for kvm.sh. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-06torture: Add torture.sh torture-everything scriptPaul E. McKenney1-0/+301
Although tailoring a specific set of kvm.sh runs has served rcutorture testing well over many years, it requires a relatively distraction-free environment, which is not always available. This commit therefore adds a prototype torture.sh script that by default tortures pretty much everything the rcutorture scripting is designed to torture, and which can be given command-line arguments to take a more focused approach. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-05torture: Do Kconfig analysis only once per scenarioPaul E. McKenney1-7/+15
Currently, if a scenario is repeated as in "--configs '4*TREE01'", the Kconfig analysis is performed for each occurrance (four times in this example) and each analysis places the exact same data into the exact same files. This is not really an issue in this repetition-four example, but it can needlessly consume tens of seconds of wallclock time for something like "--config '128*TINY01'". This commit therefore does Kconfig analysis only once per set of repeats of a given scenario, courtesy of the "sort -u" command and an automatically generated awk script. While in the area, this commit also wordsmiths a comment. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Allow standalone kvm-recheck.sh run detect --trust-makePaul E. McKenney1-1/+1
Normally, kvm-recheck.sh is run from kvm.sh, which provides the TORTURE_TRUST_MAKE environment variable that, if a non-empty string, indicates that the --trust-make command-line parameter has been passed to kvm.sh. If there was no --trust-make, kvm-recheck.sh insists that the Make.out file contain at least one "CC" command. Thus, when kvm-recheck.sh is run standalone to evaluate a prior --trust-make run, it will incorrectly insist that a proper kernel build did not happen. This commit therefore causes kvm-recheck.sh to also search the "log" file in the top-level results directory for the string "--trust-make". Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Remove "Failed to add ttynull console" false positivePaul E. McKenney2-1/+2
Commit 757055ae8ded ("init/console: Use ttynull as a fallback when there is no console") results in the string "Warning: Failed to add ttynull console. No stdin, stdout, and stderr for the init process!" appearing on the console, which the rcutorture scripting interprets as a warning, which causes every rcutorture run to be flagged. However, the rcutorture init process never attempts to do any I/O, and thus does not care that it has no stdin, stdout, or stderr. This commit therefore causes the rcutorture scripting to ignore this message. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Simplify exit-code plumbing for kvm-recheck.sh and kvm-find-errors.shPaul E. McKenney2-1/+3
This commit simplifies exit-code plumbing. It makes kvm-recheck.sh return the value 1 for a build error and 2 for a runtime error. It also makes kvm-find-errors.sh avoid checking runtime files for --build-only runs. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: s/STOP/STOP.1/ to avoid scenario collisionPaul E. McKenney2-5/+5
This commit changes the "STOP" file that is used to cleanly halt a running rcutorture run to "STOP.1" because no scenario directory will ever end with ".1". If there really was a scenario named "STOP", its directories would instead be named "STOP", "STOP.2", "STOP.3", and so on. While in the area, the commit also changes the kernel-run-time checks for this file to look directly in the directory above $resdir, thus avoiding the need to pass the TORTURE_STOPFILE environment variable to remote systems. While in the area, move the STOP.1 file to the top-level directory covering all of the scenarios. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Add --dryrun batches to help schedule a distributed runPaul E. McKenney1-5/+17
When all of the remote systems have the same number of CPUs, one approach is to use one "--buildonly" run and one "--dryrun sched" run, and then distributing the batches out one per remote system. However, the output of "--dryrun sched" is not made for parsing, so this commit adds a "--dryrun batches" that provides the same information in easily parsed form. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Stop hanging on panicPaul E. McKenney1-0/+1
By default, the "panic" kernel parameter is zero, which causes the kernel to loop indefinitely after a panic(). The rcutorture scripting will eventually kill the corresponding qemu process, but only after waiting for the full run duration plus a few minutes. This works, but delays notifying the developer of the failure. This commit therefore causes the rcutorture scripting to pass the "panic=-1" kernel parameter, which caused the kernel to instead unceremoniously shut down immediately. This in turn causes qemu to terminate, so that if all of the runs in a given batch panic(), the rcutorture scripting can immediately proceed to the next batch. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Add kvm.sh test summary to end of log filePaul E. McKenney1-8/+11
This commit adds the test summary to the end of the log in the top-level directory containing the kvm.sh test artifacts. While in the area, it adds the kvm.sh exit code to this test summary. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh include --kconfig arguments in CPU calculationPaul E. McKenney1-1/+7
Currently, passing something like "--kconfig CONFIG_NR_CPUS=2" to kvm.sh has no effect on scenario scheduling. For scenarios that do not specify the number of CPUs, this can result in kvm.sh wastefully scheduling only one scenario at a time even when the --kconfig argument would allow a number to be run concurrently. This commit therefore makes kvm.sh consider the --kconfig arguments when scheduling scenarios across the available CPUs. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh return failure upon build failurePaul E. McKenney1-1/+7
The kvm.sh script uses kvm-find-errors.sh to evaluate whether or not a build failed. Unfortunately, kvm-find-errors.sh returns success if there are no failed runs (including when there are no runs at all) even if there are build failures. This commit therefore makes kvm-find-errors.sh return failure in response to build failures. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Print run duration at end of kvm.sh executionPaul E. McKenney2-0/+39
Yes, you can mentally subtract the timestamps, but this commit makes the computer do this work. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh arguments accumulatePaul E. McKenney1-6/+6
Given that kvm.sh in invoked from scripts, it is only natural for different levels of scripting to provide their own Kconfig option values, for example. Unfortunately, right now, the last such argument on the command line wins. This commit therefore makes the --bootargs, --configs, --kconfigs, --kmake-args, and --qemu-args argument values accumulate. For example, where "--configs TREE01 --configs TREE02" would previously have run only scenario TREE02, now it will run both scenarios. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh "Test Summary" date be end of testPaul E. McKenney1-1/+3
Currently, the "date" command producing the output on the kvm.sh "Test Summary" line is executed at the beginning of the test, which produces a date that is less than helpful to someone wanting to know the duration of the test. This commit therefore defers this command's execution to the end of the test. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04tools/rcutorture: Make identify_qemu_vcpus() independent of local languageFrederic Weisbecker1-1/+1
The rcutorture scripts' identify_qemu_vcpus() function expects `lscpu` to have a "CPU: " line, for example: CPU(s): 8 But different local language settings can give different results: Processeur(s) : 8 As a result, identify_qemu_vcpus() may return an empty string, resulting in the following warning (with the same local language settings): kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expression This commit therefore changes identify_qemu_vcpus() to use getconf, which produces local-language-independend output. Cc: Josh Triplett <josh@joshtriplett.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: rcu@vger.kernel.org Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Add config2csv.sh script to compare torture scenariosPaul E. McKenney1-0/+67
This commit adds a config2csv.sh script that converts the specified torture-test scenarios' Kconfig options and kernel-boot parameters to .csv format. This allows easier comparison of scenarios when one fails and another does not. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Prepare for splitting qemu execution from kvm-test-1-run.shPaul E. McKenney1-1/+3
Distributed execution of rcutorture is eased if the qemu execution can be split from the building of the kernel, as this allows target systems to be used that are not set up to build kernels. It also avoids issues with toolchain version skew across the cluster, aside of course from qemu and KVM version skew. This commit therefore records needed data as comments in the qemu-cmd file and moves recording of the starting time to just before qemu is launched. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Allow kvm.sh --datestamp to specify subdirectoriesPaul E. McKenney1-2/+2
Scripts like kvm-check-branches.sh group runs under a single directory in resdir in order to allow easier retrospective analysis. However, they do this by letting kvm.sh create a directory as usual and then moving it after the run. This can be very confusing when looking at the results while kvm-check-branches.sh is running. This commit therefore enables --datestamp to hand subdirectories to kvm.sh. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh "--dryrun sched" summarize number of buildsPaul E. McKenney1-0/+4
Knowing the number of builds that kvm.sh will split a run into allows estimation of the duration of a test, give or take build duration. This commit therefore adds a line of output to "--dryrun sched" that gives the number of builds that will be run. This excludes "builds" for repeated scenarios that reuse an earlier build. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make kvm.sh "--dryrun sched" summarize number of batchesPaul E. McKenney1-0/+2
Knowing the number of batches that kvm.sh will split a run into allows estimation of the duration of a test, give or take the number of builds. This commit therefore adds a line of output to "--dryrun sched" that gives the number of batches that will be run. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-01-04torture: Make --kcsan specify lockdepPaul E. McKenney1-1/+1
The --kcsan argument to kvm.sh adds CONFIG_KCSAN_VERBOSE=y in order to get more detail from the KCSAN reports. However, this Kconfig option requires lockdep to be enabled. This commit therefore causes --kcsan to also enable lockdep. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06tools/rcutorture: Fix BUG parsing of console.logAnna-Maria Behnsen1-1/+1
For the rcutorture test summary log file console.log of virtual machines is parsed. When a console.log contains "DEBUG", BUG counter is incremented because regular expression does not handle to ignore DEBUG. Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Reviewed-by: Benedikt Spranger <b.spranger@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Make kvm-check-branches.sh use --allcpusPaul E. McKenney1-3/+2
Currently the kvm-check-branches.sh script calculates the number of CPUs and passes this to the kvm.sh --cpus command-line argument. This works, but this commit saves a line by instead using the new kvm.sh --allcpus command-line argument. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Allow alternative forms of kvm.sh command-line argumentsPaul E. McKenney1-3/+3
This commit allows --build-only as a synonym for --buildonly, --kconfigs for --kconfig, and --kmake-args for --kmake-arg. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Accept time units on kvm.sh --duration argumentPaul E. McKenney1-3/+15
The "--duration <minutes>" has worked well for a very long time, but it can be inconvenient to compute the minutes for (say) a 28-hour run. It can also be annoying to have to let a simple boot test run for a full minute. This commit therefore permits an "s" suffix to specify seconds, "m" to specify minutes (which remains the default), "h" suffix to specify hours, and "d" to specify days. With this change, "--duration 5" still specifies that each scenario run for five minutes, but "--duration 30s" runs for only 30 seconds, "--duration 8h" runs for eight hours, and "--duration 2d" runs for two days. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Force weak-hashed pointers on console logPaul E. McKenney1-0/+1
Although the rcutorture scripting now deals correctly with full-up security-induced pointer obfuscation, it is still counter-productive for kernel hackers who are analyzing console output. This commit therefore sets the debug_boot_weak_hash kernel boot parameter, which enables printing of weak-hashed pointers for torture-test runs. Please note that this change applies only to runs initiated by the kvm.sh scripting. If you are instead using modprobe and rmmod, it is your responsibility to build and boot the underlying kernel to your taste. Please note further that this change does not result in a security hole in normal use. The rcutorture testing runs with a negligible userspace, no networking, and no user interaction. Besides which, there is no data of value that can be extracted from an rcutorture guest OS that could not also be extracted from the host that this guest is running on. Suggested-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Prevent jitter processes from delaying failed runPaul E. McKenney2-1/+18
Even when the kernel panics and qemu dies, runs with jitter enabled will continue uselessly until the jitter.sh processes terminate. This can be annoying if a planned one-hour run instead dies during boot. This commit therefore kills the jitter.sh processes when the run ends more than one minute prior to the termination time specified by the kvm.sh --duration argument or its default. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06torture: Exclude "NOHZ tick-stop error" from fatal errorsPaul E. McKenney1-1/+2
The "NOHZ tick-stop error: Non-RCU local softirq work is pending" warning happens frequently and appears to be irrelevant to the various torture tests. This commit therefore filters it out. If there proves to be a need to pay attention to it a later commit will add an "advice" category to allow the user to immediately see that although something happened, it was not an indictment of the system being tortured. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-06rcuscale: Avoid divide by zeroPaul E. McKenney1-1/+1
The rcuscale test module does not use batches, so there is only ever one batch. This commit therefore informs the kvm-recheck-rcuscale.sh script of this fact of life. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-11-02torture: Don't kill gdb sessionsPaul E. McKenney1-1/+4
The rcutorture scripting will do a "kill -9" on any guest OS that exceeds its --duration by more than a few minutes, which is very valuable when bugs result in hangs. However, this is a problem when the "hang" was due to a --gdb debugging session. This commit therefore refrains from killing the guest OS when a debugging session is in progress. This means that the user must manually kill the kvm.sh process group if a hang really does occur. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-09-03Merge branch 'scftorture.2020.08.24a' into HEADPaul E. McKenney5-19/+58
scftorture.2020.08.24a: Torture tests for smp_call_function() and friends.
2020-08-24torture: Add gdb supportPaul E. McKenney2-8/+46
This commit adds a "--gdb" parameter to kvm.sh, which causes "CONFIG_DEBUG_INFO=y" to be added to the Kconfig options, "nokaslr" to be added to the boot parameters, and "-s -S" to be added to the qemu arguments. Furthermore, the scripting prints messages telling the user how to start up gdb for the run in question. Because of the interactive nature of gdb sessions, only one "--configs" scenario is permitted when "--gdb" is specified. For most torture types, this means that a "--configs" argument is required, and that argument must specify the single scenario of interest. The usual cautions about breakpoints and timing apply, for example, staring at your gdb prompt for too long will likely get you many complaints, including RCU CPU stall warnings. Omar Sandoval further suggests using gdb's "hbreak" command instead of the "break" command on systems supporting hardware breakpoints, and further using the "commands" option because the resulting non-interactive breakpoints are less likely to get you RCU CPU stall warnings. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>