1
0
Fork 0
Commit Graph

169 Commits (31da067023dd0e35c5ec5556f0be7a31e5588277)

Author SHA1 Message Date
Paul E. McKenney 2c667e5eae torture: Expand last_ts variable in kvm-test-1-run.sh
The kvm-test-1-run.sh script says 'test -z "last_ts"' which always
evaluates to true (AKA zero) regardless of the value of the last_ts shell
variable.  This commit therefore inserts the needed dollar sign ("$").

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-08-01 14:30:22 -07:00
Paul E. McKenney 8997e6311e torture: Suppress propagating trace_printk() warning
When trace_printk() is used, a message including "BUG" is printed to
the console, which fools the rcutorture scripting into believing that
the corresponding test scenario failed.  This commit therefore filters
out this particular instance of "BUG", thus avoiding the false-positive
test-failure report.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Paul E. McKenney b93c765fda torture: Add --trust-make to suppress "make clean"
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-28 09:06:09 -07:00
Paul E. McKenney 7225c07772 torture: Make --cpus override idleness calculations
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-28 09:06:09 -07:00
Paul E. McKenney 6dc82595ef torture: Run kernel build in source directory
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-28 09:06:09 -07:00
Paul E. McKenney cd6cb7c8a5 torture: Add function graph-tracing cheat sheet
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Paul E. McKenney 7dedfd4335 torture: Capture qemu output
Currently qemu output appears on standard output, but is inaccessible
later on.  This commit therefore captures this output and causes
kvm-recheck.sh to output this output if QEMU gave a non-zero non-137
exit code.  (And exit code of 137 indicates that QEMU was killed, in
which case we want to know about the hang rather than the fact that
QEMU was killed.)

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Sebastian Andrzej Siewior a6fda6dab9 rcutorture: Tweak kvm options
In one of my rcutorture tests the TSC clocksource got marked unstable
due to a large difference in the TSC value. I'm not sure if the guest
run for a long time with disabled interrupts or if the host was very
busy and didn't schedule the guest for some time.

I took a look on the qemu/KVM options and decided to update the options:

- Use kvm{32|64} as CPU. We could probably use `host' (like ARM does)
  for maximum available features but since we don't run any userland I'm
  not sure if it makes any difference.

- Drop the "noapic" option. There is no history why the APIC was disabled,
  I see no reason for it.  Once old qemu versions fade away, we can add
  "x2apic=on,tsc-deadline=on,hypervisor=on,tsc_adjust=on".

- Additional config options. It ensures that the kernel knowns that it
  runs as a kvm guest and can use virt devices like the kvm-clock as
  clocksource. The kvm-clock was the main motivation here.

- I didn't add a random HW device. It would make the random device ready
  earlier (not it doesn't complete the initialisation at all) but I
  doubt that there is any need for this.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[ paulmck: The world is not quite ready for CONFIG_PARAVIRT_SPINLOCKS=y
  and x2apic, so they are omitted for the time being. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Paul E. McKenney 63b29eaed6 torture: Make kvm-find-errors.sh and kvm-recheck.sh provide exit status
This commit causes both kvm-find-errors.sh and kvm-recheck.sh to provide
an exit status based on whether or not errors were located.  In the
case of kvm-recheck.sh, this will be the error status of the last run.
This change allows these commands to be used in scripting and Makefiles
to automatically report failed rcutorture runs.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Joel Fernandes (Google) dd064c3599 rcutorture: Add cpu0 to the set of CPUs to add jitter
jitter.sh currently does not add CPU0 to the list of CPUs for adding of
jitter. Let us add it to this list even when it is not hot-pluggable.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Joel Fernandes (Google) e0e2147c1a rcutorture: Select from only online CPUs
The rcutorture jitter.sh script selects a random CPU but does not check
if it is offline or online. This leads to taskset errors many times. On
my machine, hyper threading is disabled so half the cores are offline
causing taskset errors a lot of times. Let us fix this by checking from
only the online CPUs on the system.

Cc: rcu@vger.kernel.org
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-05-28 09:06:09 -07:00
Paul E. McKenney 164a4daaea torture: Suppress false-positive CONFIG_INITRAMFS_SOURCE complaint
The scripting must supply the CONFIG_INITRAMFS_SOURCE Kconfig option
so that kbuild can find the desired initrd, but the configcheck.sh
script gets confused by this option because it takes a string instead
of the expected y/n/m.  This causes checkconfig.sh to complain about
CONFIG_INITRAMFS_SOURCE in the torture-test output (though not in the
summary).  As more people use rcutorture, the resulting confusion is
an increasing concern.

This commit therefore suppresses this false-positive warning by filtering
CONFIG_INITRAMFS_SOURCE from within the checkconfig.sh script.

Reported-by: Joel Fernandes <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-03-26 14:42:53 -07:00
Paul E. McKenney fef141f619 tools/.../rcutorture: Convert to SPDX license identifier
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>
2019-03-26 14:42:53 -07:00
Willy Tarreau 30ca20517a tools headers: Move the nolibc header from rcutorture to tools/include/nolibc/
As suggested by Ingo, this header file might benefit other tools than
just rcutorture. For now it's quite limited, but is easy to extend, so
exposing it into tools/include/nolibc/ will make it much easier to
adopt by other tools.

The mkinitrd.sh script in rcutorture was updated to use this new location.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-01-25 15:37:13 -08:00
Willy Tarreau cc72a50994 rcutorture/nolibc: Add a bit of documentation to explain how to use nolibc
Ingo rightfully asked for a bit more documentation in the nolibc header,
so this patch adds some explanation about its purpose, how it's made, and
how to use it.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
2019-01-25 15:37:13 -08:00
Willy Tarreau 85ebb12c4e rcutorture/nolibc: Fix some poor indentation and alignment
A few macros had their rightmost backslash misaligned, and the pollfd
struct definition resisted the previous code reindent. Nothing else
changed.

Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
2019-01-25 15:37:12 -08:00
Willy Tarreau f90a66d685 rcutorture/nolibc: Fix the clobbered registers in the MIPS syscall definition
A last-minute checkpatch cleanup caused most of list of clobbered
registers to be lost in the MIPS syscall definition. Although this code
is not yet used on MIPS, it is nevertheless better to fix it before it
does get used.

Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2019-01-25 15:37:11 -08:00
Paul E. McKenney 0d8a9ea976 torture: Explain and simplify odd "for" loop in mkinitrd.sh
Why a Bourne-shell "for" loop?  And why 192 instances of "a"?  This commit
adds a shell comment to present the answer to these mysteries.  It also
uses a series of factor-of-four Bourne-shell assignments to make it
easy to see how many instances there are, replacing the earlier wall of
'a' characters.

Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
[ paulmck: Fix wrong-variable bugs noted by Andrea Parri. ]
2019-01-25 15:37:09 -08:00
Willy Tarreau b94ec36896 rcutorture: Make use of nolibc when available
This reduces the size of the init executable from ~800 kB to ~800 bytes
on x86_64. This is only implemented for x86_64, i386, arm and arm64.
Others not tested.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Willy Tarreau 66b6f755ad rcutorture: Import a copy of nolibc
This is a definition of the most common syscalls needed in minimalist
init executables, allowing to statically build them with no external
dependencies. It is sufficient in its current form to build rcutorture's
init on x86_64, i386, arm, and arm64. Others have not been ported or
tested. Updates may be found here :

     http://git.formilux.org/?p=people/willy/nolibc.git

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Willy Tarreau 825fa4cdfb rcutorture: Check initrd/init instead of initrd only
If the build fails, we can end up with an empty initrd directory which
prevents the build script from operating again. Better rely on the
resulting init executable instead.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Willy Tarreau 18d7bf8ed3 rcutorture: Always strip using the cross-compiler
Strip using -s on the compiler command line instead of calling the "strip"
utility as the latter isn't necessarily compatible with the target arch.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Paul E. McKenney 70e9f50477 rcutorture: Add cross-compile capability to initrd.sh
This adds the CROSS_COMPILE environment to the initrd.sh script's
gcc command to enable cross compilation.

Reported-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Paul E. McKenney 229ab0cb5b rcutorture: Make initrd/init execute in userspace
Currently, the initrd/init script and executable remain blocked almost
all the time.  However, it is necessary to test nohz_full userspace
execution, which both variants of initrd/init fail to do.  This commit
therefore causes initrd/init to spend about a millisecond per second
executing in userspace.

Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Paul E. McKenney 38e630424b rcutorture: Add initrd support for systems lacking dracut
The support for creating initrd directories using dracut is a great
improvement over having to always hand-create them, it is a bit annoying
to have to install some otherwise irrelevant package just to be able to
run rcutorture.  This commit therefore adds support for creating initrd
directories on systems innocent of dracut.  You do need gcc, but then
again you need that to build the kernel (or to build llvm) in any case.

The idea is to create an initrd directory containing nothing but a
statically linked binary having a for-loop over a long-term sleep().
The result is a Linux kernel with almost no userspace: even the
time-honored /dev, /lib, /tmp, and /usr directories are gone.  In fact,
the only directory present is "/", but only because I don't know how to
get rid of it, at least short of not having an initrd in the first place.
Although statically linked binaries are much maligned, and rightly so,
their disadvantages seem to be irrelevant for this particular use case.
From https://www.akkadia.org/drepper/no_static_linking.html:

1.	Fixes are difficult to apply to hordes of widely scattered
	statically linked binaries.  But in this case, there is only one
	binary, but there would otherwise be no fewer than four libraries.

2.	Security measures like local address randomization cannot be used.
	Prudence prevents me from asserting that it is impossible to
	base a remote attack on a networking-free rcutorture instance.
	Nevertheless, bonus points to the first person who comes up with
	such an attack!

3.	More efficient use of physical memory.  Not in this case, given
	that libc is 1.8MB and the statically linked binary "only" 800K.

4.	Features such as locales, name service switch (NSS),
	internationalized domain names (IDN) tool, and so on require
	dynamic linking.  Bonus points to the first person coming up
	with a valid rcutorture use case requiring these features in
	its initrd.

5.	Accidental violations of (L)GPL.  Actually, this change actually
	helps -avoid- such violations by reducing the temptation to
	pass around tarballs of rcutorture-ready initrd directories.
	After all, the rcutorture scripts automatically create an initrd
	directory for you, so why bother with the tarballs?

6.	Tools and hacks like ltrace, LD_PRELOAD, LD_PROFILE, and LD_AUDIT
	don't work.  Again, bonus points to the first person coming up
	with a valid rcutorture use case requiring these features in
	its initrd.

Nevertheless, the script will use dracut if available, and will create the
statically linked binary only when dracut are missing.  Those preferring
the smaller initrd directory resulting from the statically linked binary
(like me) are free to hand-edit mkinitrd.sh to remove the code using
dracut.  ;-)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-11-08 21:52:55 -08:00
Connor Shu 8f15c682ac rcutorture: Automatically create initrd directory
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-11-08 21:52:55 -08:00
Paul E. McKenney 31e7490741 torture: Stop overwriting Make.out file with obsolete version
The old approach placed all the build products into the b* directories,
which meant that some of these build products needed to be copied to
the proper directory in the res hierarchy.  The new approach leaves
things like .config and the .o files in the b1 directory, but directs
build output and diagnostics directly to the proper directory in the
res hierarchy.  Unfortunately, one of the copies was still carried out,
which could (and sometimes did) overwrite the build output and diagnostics
with obsolete output remaining in the b1 directory.

This commit therefore removes the offending "cp" command.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-08-29 09:20:48 -07:00
Paul E. McKenney b4c1906f65 rcutorture: Make kvm-find-errors.sh find close calls
Although warnings about close calls are printed by kvm-recheck.sh,
kvm-find-errors.sh currently ignores them.  This could easily result
in someone failing to investigate close calls, so this commit makes
them visible to kvm-find-errors.sh.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-06-25 11:30:10 -07:00
Paul E. McKenney 5bfd7d34fe torture: Use a single build directory for torture scenarios
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-06-25 11:30:10 -07:00
Paul E. McKenney da1a1e1923 torture: Make kvm-find-errors.sh find build warnings
Currently, kvm-find-errors.sh looks only for build errors ("error:"),
so this commit makes it also locate build warnings ("warning:").

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
2018-05-15 10:32:25 -07:00
Paul E. McKenney b4e8afbd21 rcutorture: Abbreviate kvm.sh summary lines
With the addition of the end-of-test state, it is not uncommon for the
kvm.sh summary lines to overflow 80 characters.  This commit therefore
applies abbreviations in order to make the line fit into 80 characters
with high probability.

And yes, I did make heavy use of punched cards back in the day, so 80
columns it is for my xterms!  ;-)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
2018-05-15 10:32:17 -07:00
Paul E. McKenney 413e5512bc rcutorture: Print end-of-test state in kvm.sh summary
This commit adds the end-of-test test, if present in the console output,
to the kvm.sh test summary that is printed by kvm-recheck.sh.  Note that
this only applies to rcutorture console output.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
2018-05-15 10:32:13 -07:00
Paul E. McKenney d600e06ba7 torture: Fold parse-torture.sh into parse-console.sh
The rcutorture scripting scans the console output twice, once to look
for various sorts of hangs and again to find warnings and panics.
Unfortunately, only the output of the second scan gets written to the
console.log.diags file, which can cause hangs to be overlooked.
This commit therefore folds the parse-torture.sh script (which looks
for hangs) into the parse-console.sh script (which looks for warnings
and panics).  This allows both types of failure information to be
added to console.log.diags, while still reliably removing this file
when it proves to be empty.

This also fixes a long-standing bug where rcuperf log files would
unconditionally complain about a hang.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
2018-05-15 10:32:04 -07:00
Paul E. McKenney 95ce5f29e1 torture: Add a script to edit output from failed runs
This commit adds a script that allows viewing the build and/or
console output from failed rcutorture, locktorture, or rcuperf runs.
This replaces a time-honored but inefficient manual procedure that uses
cut and paste.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Nicholas Piggin <npiggin@gmail.com>
2018-05-15 10:31:52 -07:00
Paul E. McKenney 0da8c08d71 torture: Grace periods do not piggyback off of themselves
The rcuperf trace-event processing counted every "done" trace event
as a piggyback, which is incorrect because the task that started the
grace period didn't piggyback at all.  This commit fixes this problem
by recording the task that started a given grace period and ignoring
that task's "done" record for that grace period.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20 16:22:01 -08:00
Paul E. McKenney cc839ce55d torture: Adjust rcuperf trace processing to allow for workqueues
The rcuperf event-trace processing assumes that expedited grace periods
start and end on the same task, an assumption that was violated by moving
expedited grace-period processing to workqueues.  This commit removes
this now-fallacious assumption from rcuperf's event-trace processing.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20 16:22:00 -08:00
Paul E. McKenney adcfe76c61 torture: Default jitter off when running rcuperf
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-20 16:22:00 -08:00
Paul E. McKenney 642146b1ad torture: Specify qemu memory size with --memory argument
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-20 16:21:59 -08:00
Lihao Liang 67ad71ddbc rcutorture: Add basic ARM64 support to run scripts
This commit adds support of the qemu command qemu-system-aarch64
to rcutorture.

Signed-off-by: Lihao Liang <lianglihao@huawei.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2018-02-20 16:21:59 -08:00
Paul E. McKenney db92ca3ab8 rcutorture: Update kvm.sh header comment
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>
2018-02-20 16:21:58 -08:00
SeongJae Park af0695d3fc rcutorture/kvm-build.sh: Skip build directory check
Check for build-directory existence and write permissions are provided in
both 'kvm-test-1-run.sh' an 'kvm-build.sh'.  Because the 'kvm-build.sh'
is dependent on 'kvm-test-1-run.sh' ('kvm-build.sh' uses variables that
defined from its caller.), these checks are unnecessarily duplicated.
This commit therefore removes the check in from the 'kvm-build.sh' script.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11 09:18:27 -08:00
SeongJae Park feef2d286a rcutorture: Simplify functions.sh include path
Inclusions of 'functions.sh' from 'kvm-test-1-run.sh' and
'kvm-recheck*.sh' use its absolute path.  Because the directory containing
'functions.sh' is already in PATH, the full path is unnecessary.  This
commit therefore simplifies the inclusions to use the short relative path.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11 09:18:26 -08:00
SeongJae Park fa48beb5f4 rcutorture: Simplify logging
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-11 09:18:26 -08:00
SeongJae Park 81394e3f6d rcutorture/kvm-recheck-*: Improve result directory readability check
The kvm-recheck-(lock|rcu|rcuperf).sh scripts check whether the
user-specified results directory exists.  If not, it prints out error
message that says the specified directory is unreadable.  To make the
message more precise, this commit adds a readability check.

Fixes: 2193e1604e ("rcutorture: Abstract kvm-recheck.sh")

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11 09:18:25 -08:00
SeongJae Park 512e3bd0b5 rcutorture/kvm.sh: Support execution from any directory
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-11 09:18:25 -08:00
SeongJae Park 8dcd6f3fe2 rcutorture/kvm.sh: Use consistent help text for --qemu-args
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: e9ce640001 ("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-11 09:18:24 -08:00
SeongJae Park e5ed531dca rcutorture/kvm.sh: Remove unused variable, `alldone`
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-12-11 09:18:24 -08:00
SeongJae Park 3a0b3bbbff rcutorture: Remove unused script, config2frag.sh
The 'config2frag.sh' script is not used, so this commit removes it.

Fixes: c87b9c601a ("rcutorture: Add KVM-based test framework")

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11 09:18:24 -08:00
SeongJae Park 2adfa4210f rcutorture/configinit: Fix build directory error message
The 'configinit.sh' script checks the format of optional argument for the
build directory, printing an error message if the format is not valid.
However, the error message uses the wrong variable, indicating an empty
string even though the user entered a non-empty (but erroneous) string.
This commit fixes the script to use the correct variable.

Fixes: c87b9c601a ("rcutorture: Add KVM-based test framework")

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-12-11 09:18:23 -08:00
Paul E. McKenney cf8d8b0051 torture: Prepare scripting for shift from %p to %pK
Because %p prints "(null)" and %pK prints "0000000000000000" or (on
32-bit systems) "00000000", this commit adjusts torture-test scripting
accordingly.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-11-28 15:54:27 -08:00