aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm.sh (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-28torture: Add --trust-make to suppress "make clean"Paul E. McKenney1-0/+6
The current rcutorture scripts unconditionally do "make clean", which is a good way of getting the needed testing done despite any imperfections in Makefile dependency tracking. However, this can be a bit irritating when repeatedly running a single scenario after small changes, for example, when debugging a problem that affects only a single scenario. This commit therefore adds a --trust-make argument that suppresses the "make clean". Even when using ccache, this speeds up kernel builds by up to almost an order of magnitude on my laptop. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Make --cpus override idleness calculationsPaul E. McKenney1-0/+3
Currently, rcutorture will use relatively few CPUs to build the kernel on a busy system, which is often as it should be. However, if the user has used the --cpus argument to dedicate a specified number of CPUs to this torture test, it would be good if the kernel build also made use of them. This commit therefore changes the cpus2use.sh script to use --cpus when specified and to do the idleness calculations otherwise. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Run kernel build in source directoryPaul E. McKenney1-2/+1
For historical reasons, rcutorture places its build products in a tools/testing/selftests/rcutorture/b1 directory using the O= kbuild command-line argument. However, doing this requires that the source directory be pristine: Not just "make clean" pristine, but instead "make mrproper" (or, equivalently, "make distclean") pristine. Therefore, rcutorture executes a "make mrproper" before each build. Unfortunately, "make mrproper" has the side effect of removing pretty much everything, including tags files and cscope databases, which can be inconvenient to people whose workflow centers around a single source tree. This commit therefore makes rcutorture do the build directly in the source directory, removing the need for "make mrproper". This works because all needed build products are moved to their proper place in the "res" directory immediately after the build completes, so that multiple rcutorture kernels can still run concurrently. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28torture: Add function graph-tracing cheat sheetPaul E. McKenney1-0/+2
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-03-26tools/.../rcutorture: Convert to SPDX license identifierPaul E. McKenney1-15/+2
Replace the license boiler plate with a SPDX license identifier. While in the area, update an email address and add copyright notices. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2018-11-08rcutorture: Automatically create initrd directoryConnor Shu1-0/+8
The rcutorture scripts currently expect the user to create the tools/testing/selftests/rcutorture/initrd directory. Should the user fail to do this, the kernel build will fail with obscure and confusing error messages. This commit therefore adds explicit checks for the tools/testing/selftests/rcutorture/initrd directory, and if not present, creates one on systems on which dracut is installed. If this directory could not be created, a less obscure error message is emitted and the test is aborted. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Connor Shu <Connor.Shu@ibm.com> [ paulmck: Adapt the script to fit into the rcutorture framework and severely abbreviate the initrd/init script. ] Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-06-25torture: Use a single build directory for torture scenariosPaul E. McKenney1-1/+1
The torture scripting currently builds each kernel from a set of parallel runs in its own build directory. This can waste quite a bit of space when running large numbers of concurrent scenarios, and pointlessly given that the builds are run sequentially (albeit with a largish -j number passed to "make"). This commit therefore places all build-command output in the results directory, then does all builds in a single "b1" build directory. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20torture: Default jitter off when running rcuperfPaul E. McKenney1-0/+6
The purpose of jitter is to expose concurrency bugs due to invalid assumptions about forward progress. There is usually little point in jitter when measuring performance. This commit therefore defaults jitter off when running rcuperf. You can override this by specifying the kvm.sh "--jitter" argument -after- the "--torture rcuperf" argument. No idea why you would want this, but if you do, that is how you do it. One example of a conccurrency bug that this jitter might expose is one in which the developer assumed that a given short region of code would be guaranteed to execute within some short time limit. Such assumptions are invalid in virtualized environments because the hupervisor can preempt the guest OS at any point, even when the guest OS thinks that it has disabled interrupts. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20torture: Specify qemu memory size with --memory argumentPaul E. McKenney1-0/+8
The 512 megabyte memory size has served quite well, but more memory is required when using large trace buffers on large systems. This commit therefore adds a --memory argument to the kvm.sh script, which allows the memory size to be specified on the command line, for example, "--memory 768", --memory 800M", or "--memory 2G". Reported-by: Sebastian Siewior <bigeasy@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20rcutorture: Update kvm.sh header commentPaul E. McKenney1-5/+3
The kvm.sh header comment is a bit of a relic, so this commit brings it up to date. Reported-by: Lihao Liang <lianglihao@huawei.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11rcutorture: Simplify loggingSeongJae Park1-21/+11
Both the 'kvm.sh' and 'kvm-test-1-run.sh' scripts log messages by printing the message to 'stdout' and then also printing it into the log file. Generation of the message thus occurs twice, once for 'stdout' and once for the log file. Moreover, many of the messages contain 'date' output, which results in date being invoked twice (once for stdout print, once for log file write). As a result, the date information in stdout and log file can differ, which could cause confusion. This commit therefore simplifies the logging procedure by using 'tee'. Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11rcutorture/kvm.sh: Support execution from any directorySeongJae Park1-2/+3
The 'kvm.sh' rcutorture script requires that it be invoked from the top of Linux-kernel source tree. It is just a subtle restriction, but users using it for the first time could forget the restriction and be confused. Moreover, it makes commands a little longer, which can be frustrating. This commit therefore lets users invoke the script from any location. Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11rcutorture/kvm.sh: Use consistent help text for --qemu-argsSeongJae Park1-2/+2
The '--qemu-args' option's help text is wrongly copied from '--qemu-cmd' option and its argument type description message format is inconsistent with other arguments. This commit fixes the usage and type messages to be consistent with others. Fixes: e9ce640001c6 ("rcutorture: Add --qemu-args argument to kvm.sh") Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11rcutorture/kvm.sh: Remove unused variable, `alldone`SeongJae Park1-1/+0
The variable `alldone` is defined but not used within an awk script. This commit therefore removes it. Fixes:53954671033d ("rcutorture: Do better bin packing") Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-10-09torture: Provide TMPDIR environment variable to specify tmpdirPaul E. McKenney1-2/+2
Both rcutorture and locktorture currently place temporary files in /tmp, in keeping with decades-long tradition. However, sometimes it is useful to specify an alternative temporary directory, for example, for space or performance reasons. This commit therefore causes the torture-test scripting to use the path specified in the TMPDIR environment variable, or to fall back to traditional /tmp if this variable is not set. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-07-24rcutorture: Use nr_cpus rather than maxcpus to limit test sizePaul E. McKenney1-0/+1
The maxcpus= kernel boot parameter limits the number of CPUs brought online at boot time, but it does nothing to prevent additional CPUs from being brought up later. Placing a hard cap on the total number of CPUs is instead the job of the nr_cpus= boot parameter. This commit therefore switches the configfrag_boot_cpus() shell function from maxcpus= to nr_cpus=. This commit also adds a nr_cpus=43 kernel parameter to RCU's TREE01 test scenario, but retains the maxcpus=8 kernel parameter in order to test the ability of RCU expedited grace periods to handle new CPUs coming online for the first time during grace-period initialization. Finally, this commit makes the torture scheduling allow maxcpus= to override other means of specifying the number of CPUs to allow for. This last works because the torture kernel modules size their workloads based on the number of CPUs present at the start of the test, not the ultimate number of CPUs. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-07-24rcutorture: Don't wait for kernel when all builds failPaul E. McKenney1-7/+18
Currently, rcutorture groups runs in batches, building each scenario in a given batch, then invoking qemu to run all the kernels in the batch. Of course, if a given scenario's kernel fails to build, there is no qemu run for that scenario. And if all of the kernels in a given batch fail to build, there are no runs, and rcutorture immediately starts on the next batch. But not if --jitter has been specified, which it is by default. In this case, the jitter scripts are started unconditionally, and rcutorture waits for them to complete, even though there are no kernels to run. This commit therefore checks for this situation, and refuses to start jitter unless at least one of the kernels in the batch built successfully. This saves substantial time when all scenarios' kernels fail to build, particularly if a long --duration was specified. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-07-24torture: Add --kconfig argument to kvm.shPaul E. McKenney1-0/+8
Currently, testing a variant of an existing scenario requires editing that scenario's file or creating a new scenario file. This is messy and error prone with respect to changes to scenarios. This commit therefore adds a --kconfig argument to kvm.sh, so that '--kconfig "CONFIG_RCU_TRACE=y CONFIG_RCU_EQS_DEBUG=n" will override those two Kconfig options. In addition, there is now clear precedence: the config fragment overrides CFcommon, and the --kconfig argument overrides both. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-06-08rcutorture: Add "git diff" output to testid.txt filePaul E. McKenney1-4/+1
Currently, when running from a git archive, the testid.txt file contains only the branch name, the output of "git status", and the SHA-1 of the current HEAD. This is useful, but does not uniquely identify the source code that was built. This commit therefore adds the output of "git diff HEAD", which means that if two testid.txt files compare equal, they correspond to exactly the same source code. Give or take the possibility of SHA-1 collisions, that is. ;-) Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2016-11-14torture: Prevent jitter from delaying build-only runsPaul E. McKenney1-0/+5
Currently, if the --jitter flag specifies jitter for a --build-only run, the system will obediently build a kernel, refuse to launch it, launch the requested number of jitter processes, and wait for the specified kernel run time, which defaults to 30 minutes. This is of course quite pointless. This commit therefore disables jitter on build-only runs. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2016-06-14torture: Inflict default jitterPaul E. McKenney1-1/+1
This commit enables jitter by default. It may be manually disabled by passing "--jitter 0" to kvm.sh. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2016-04-21rcutorture: Add OS-jitter capabilityPaul E. McKenney1-0/+18
This commit adds a --jitter OS-jitter capability to expose bugs based on no-delay assumptions. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2016-03-31rcutorture: Convert test duration to seconds earlyPaul E. McKenney1-2/+2
This commit converts test duration from minutes to seconds early on in order to prepare for upcoming OS-jitter-injection changes. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2016-03-31rcutorture: Update scripting to accommodate rcuperfPaul E. McKenney1-1/+1
This commit adds the scripting changes to add support for the shiny new rcuperf kernel module. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2015-12-05rcutorture: Default grace period to three minutes, allow overridePaul E. McKenney1-0/+7
The default test grace period of two minutes is insufficient in some cases and excessive in others. This commit therefore increases the default to three minutes, but also adds a --shutdown-grace parameter to allow the default to be overridden. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2015-12-05rcutorture: Add batch number to script printoutPaul E. McKenney1-6/+9
Currently, the scripts print "----Start batch" at the beginning of each batch, which does serve as a good visual delimiter between batches. Unfortunately, if there are a lot of batches, it is hard to quickly estimate test runtime from the output of "--dryrun sched". This commit therefore adds a batch number, so that the beginning-of-batch output looks like this "----Start batch 10" for the tenth batch. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2015-10-06torture: Forgive non-plural argumentsPaul E. McKenney1-3/+3
This commit allows --bootarg instead of --bootargs, --config instead of --configs, and --qemu-arg instead of --qemu-args. For those cases where a native English speaker might auto-correct the argument to be incorrect. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2015-05-27rcutorture: Allow repetition factors in Kconfig-fragment listsPaul E. McKenney1-6/+19
Although it is currently possible to run the same test in parallel, '--config "TINY01 TINY01 TINY01"' can get a bit verbose, especially if you want to run 48 instances of TINY01 in parallel. This commit therefore allows prefixing the Kconfig fragment with a repeat count, for example, '--config "48*TINY01"' to run 48 instances in parallel. At least assuming that you have 48 CPUs and also gave '--cpus 48'. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2015-03-03torture: Avoid script syntax error when insufficient CPUsPaul E. McKenney1-1/+1
Parentheses are special to bash, so use an overflow flag that doesn't use them. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-11-03rcutorture: Remove obsolete kversion param in kvm.shPranith Kumar1-14/+5
Now that we have removed configs based on kernel version, we can also remove the kversion parameter in kvm.sh. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-09-07rcutorture: Specify MAXSMP=y for TREE01Paul E. McKenney1-1/+3
Setting CONFIG_MAXSMP=y causes cpumasks to be moved offstack, which introduces the possibility of NULL cpumask_var_t pointers. This commit therefore enables CONFIG_MAXSMP=y in TREE01 to increase test coverage. However, because CONFIG_MAXSMP=y implies 8192 CPUs, we need to use the maxcpus= boot parameter to limit the number of CPUs to something reasonable, which in turn requires updating the scripts to handle this. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
2014-09-07rcutorture: Set executable bit and drop bash from UsagePranith Kumar1-1/+1
This commit sets the executable bit on test scripts config2frag.sh and kvm.sh. Since #!/bin/bash is set in all the scripts, this commit also drops it from all usage lines because the scripts can now all be invoked directly. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-09-07rcutorture: Use bash shell for all the test scriptsPranith Kumar1-1/+1
Some of the scripts encode a default /bin/sh shell. On systems which use dash as default shell, these scripts fail as they are bash scripts. I encountered this while testing the sprintf() changes on a Debian system where dash is the default shell. This commit changes all such uses to use bash explicitly. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-06-26torture: Clean up diagnostics from --buildonly runsPaul E. McKenney1-9/+12
Currently the post-processing complains about the lack of rcutorture output when --buildonly is set and also emits misleading messages about kernels being started and finishing. This commit suppresses these complaints and messages. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-05-14rcutorture: Note diffs from git commitsPaul E. McKenney1-0/+4
The current scripting only keeps track of the git SHA-1 of the current HEAD. This can cause confusion in cases where testing ran in a git tree where changes had not yet been checked in. This commit therefore also records the output of "git diff HEAD" to provide the information needed to reconstruct the source tree that was tested. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Choose bzImage location based on architecturePaul E. McKenney1-0/+8
Currently, the scripts hard-code arch/x86/boot/bzImage, which does not work well for other architectures. This commit therefore provides a identify_boot_image function that selects the correct bzImage location relative to the top of the Linux source tree. This commit also adds a --bootimage argument that allows selecting some other file, for example, "vmlinux". This change requires that the definition of the QEMU variable be computed earlier in order to identify where to look for the boot image when it comes time to copy it to the results directory. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Permit multi-word qemu and boot argumentsPaul E. McKenney1-2/+2
This commit applies quotes to permit multi-word --qemu-args and --bootargs arguments. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Make "--dryrun script" use same environment as normal runPaul E. McKenney1-15/+11
In a normal torture-test run, the script inherits its environment variables, but this does not work when producing a script that is to run later. Therefore, definitions and exports are prepended to a dryrun script but not to a script that is run immediately. This commit reconciles this by placing definitions and exports at the beginning of the script in both cases. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Conflicts: tools/testing/selftests/rcutorture/bin/kvm.sh
2014-05-14torture: Make "--dryrun script" output self-sufficientPaul E. McKenney1-33/+27
The scripts produced by kvm.sh's "--dryrun script" argument were intended for debugging rather than to run, but it is easier to debug if the script output matches exactly what is run. This commit therefore makes this script runnable. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_QEMU_CMD to TORTURE_QEMU_CMDPaul E. McKenney1-2/+2
This commit makes the torture scripts a bit more RCU-independent. It also removes a redundant export of this same shell variable. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_QEMU_ARG to TORTURE_QEMU_ARGPaul E. McKenney1-3/+3
This commit makes the torture scripts a bit more RCU-independent. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_QEMU_MAC to TORTURE_QEMU_MACPaul E. McKenney1-2/+2
This commit makes the torture scripts a bit more RCU-independent. It also drops an redundant "export" statement. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_QEMU_INTERACTIVE to TORTURE_QEMU_INTERACTIVEPaul E. McKenney1-2/+2
This commit makes the torture scripts a bit more RCU-independent. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_BUILDONLY to TORTURE_BUILDONLYPaul E. McKenney1-3/+6
This commit makes the torture scripts a bit more RCU-independent by changing RCU_BUILDONLY to TORTURE_BUILDONLY. It also removes an unnecessary export command. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_BOOTARGS to TORTURE_BOOTARGSPaul E. McKenney1-3/+3
This commit makes the torture scripts a bit more RCU-independent. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Rename RCU_KMAKE_ARG to TORTURE_KMAKE_ARGPaul E. McKenney1-3/+3
This commit makes the torture scripts a bit more RCU-independent by changing RCU_KMAKE_ARG to TORTURE_KMAKE_ARG. It also removes the unnecessary export command. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-14torture: Allow variations of "defconfig" to be specifiedPaul E. McKenney1-0/+8
Some environments require some variation on "make defconfig" to initialize the .config file. This commit therefore adds a --defconfig argument to allow this to be specified. The default value is of course "defconfig". Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13torture: Rename RCU_INITRD to TORTURE_INITRDPaul E. McKenney1-3/+3
This commit makes the torture scripts a bit more RCU-independent. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13torture: Add batch headers "--dryrun sched"Paul E. McKenney1-1/+2
This commit makes the output of "--dryrun sched" more user-friendly, clearly indicating the batch starts. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
2014-05-13torture: Remove obsolete builddir optionsPaul E. McKenney1-16/+0
The --builddir and --relbuilddir options were initially intended to handle parallel tests. However, since commit 43e38ab3d518 (Enable concurrent rcutorture runs), the script manages multiple build directories as needed for parallel testing. This commit therefore removes these two obsolete options. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>