History log of /linux-master/tools/testing/selftests/rcutorture/bin/parse-console.sh
Revision Date Author Comments
# 3e9b009c 08-Sep-2023 Paul E. McKenney <paulmck@kernel.org>

torture: Convert parse-console.sh to mktemp

This commit does the long-overdue conversion of the parse-console.sh
file to use mktemp to create its temporary directory.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>


# fcc7a329 15-Aug-2023 Joel Fernandes (Google) <joel@joelfernandes.org>

rcutorture: Copy out ftrace into its own console file

When debugging, it can be difficult to quickly find the ftrace dump
within the console log, which in turn makes it difficult to process it
independent of the rest of the console output. This commit therefore
copies the contents of the buffers into its own file to make it easier
to locate and process the ftrace dump. The original ftrace dump is still
available in the console log in cases because it can be more convenient
to process it in situ, for example, for scripts that process console
output as well as ftrace-dump data.

Also handle the case of multiple ftrace dumps potentially showing up in the
log. Example for a file like [1], it will extract as [2].

[1]:
foo
foo
Dumping ftrace buffer:
---------------------------------
blah
blah
---------------------------------
more
bar
baz
Dumping ftrace buffer:
---------------------------------
blah2
blah2
---------------------------------
bleh
bleh

[2]:

Ftrace dump 1:
blah
blah

Ftrace dump 2:
blah2
blah2

[ paulmck: Fixed awk indentation, input up front. ]

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>


# eeb4dd9e 22-Nov-2022 Tiezhu Yang <yangtiezhu@loongson.cn>

selftests: rcutorture: Use "grep -E" instead of "egrep"

The latest version of grep is deprecating the egrep command, so that
its output contains warnings as follows:

egrep: warning: egrep is obsolescent; using grep -E

Fix this using "grep -E" instead.

sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/testing/selftests/rcutorture`

Here are the steps to install the latest grep:

wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz
tar xf grep-3.8.tar.gz
cd grep-3.8 && ./configure && make
sudo make install
export PATH=/usr/local/bin:$PATH

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# a711aacc 04-Dec-2021 Paul E. McKenney <paulmck@kernel.org>

torture: Make kvm.sh summaries note runs having only KCSAN reports

Runs having only KCSAN reports will normally print a summary line
containing only a "Bugs:" entry. However, these bugs might or might
not be KCSAN reports. This commit therefore flags runs in which all the
"Bugs:" entries are KCSAN reports.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# 546eee2d 23-Dec-2020 Paul E. McKenney <paulmck@kernel.org>

torture: Remove "Failed to add ttynull console" false positive

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>


# 01f9e708 02-Nov-2020 Anna-Maria Behnsen <anna-maria@linutronix.de>

tools/rcutorture: Fix BUG parsing of console.log

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>


# 4e88ec4a 11-Aug-2020 Paul E. McKenney <paulmck@kernel.org>

rcuperf: Change rcuperf to rcuscale

This commit further avoids conflation of rcuperf with the kernel's perf
feature by renaming kernel/rcu/rcuperf.c to kernel/rcu/rcuscale.c, and
also by similarly renaming the functions and variables inside this file.
This has the side effect of changing the names of the kernel boot
parameters, so kernel-parameters.txt and ver_functions.sh are also
updated. The rcutorture --torture type was also updated from rcuperf
to rcuscale.

[ paulmck: Fix bugs located by Stephen Rothwell. ]
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# 687d4775 30-Jun-2020 Paul E. McKenney <paulmck@kernel.org>

torture: Declare parse-console.sh independence from rcutorture

Currently, parse-torture.sh looks at the fifth field of torture-test
console output for the version number. This works fine for rcutorture,
but not for scftorture, which lacks the pointer field. This commit
therefore adjusts matching lines so that the parse-console.sh awk script
always sees the version number as the first field in the lines passed
to it.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# bc77a72c 10-Jun-2020 Paul E. McKenney <paulmck@kernel.org>

torture: Abstract out console-log error detection

This commit pulls the simple pattern-based error detection from the
console log into a new console-badness.sh file. This will enable future
commits to end a run on the first error.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# 59359e4f 26-Apr-2020 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Handle non-statistic bang-string error messages

The current console parsing assumes that console lines containing "!!!"
are statistics lines from which it can parse the number of rcutorture
too-short grace-period failures. This prints confusing output for
other problems, including memory exhaustion. This commit therefore
differentiates between these cases and prints an appropriate error string.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# f71d8311 17-Jun-2020 Paul E. McKenney <paulmck@kernel.org>

refscale: Change --torture type from refperf to refscale

This commit renames the rcutorture config/refperf to config/refscale to
further avoid conflation with the Linux kernel's perf feature.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# f8b4bb23 25-May-2020 Paul E. McKenney <paulmck@kernel.org>

torture: Add refperf to the rcutorture scripting

This commit updates the rcutorture scripting to include the new refperf
torture-test module.

Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>


# 8997e631 22-May-2019 Paul E. McKenney <paulmck@kernel.org>

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>


# fef141f6 11-Feb-2019 Paul E. McKenney <paulmck@kernel.org>

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>


# b4c1906f 03-May-2018 Paul E. McKenney <paulmck@kernel.org>

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>


# d600e06b 01-Mar-2018 Paul E. McKenney <paulmck@kernel.org>

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>


# 682ed706 21-Apr-2016 Paul E. McKenney <paulmck@kernel.org>

torture: Add starvation events to error summary

This commit adds a string of the form "Starves: 10" to the summary
line for error conditions found in the console output.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# 5d43edb4 09-Dec-2015 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Check for self-detected stalls

The current scripts parse console output only for cases where one CPU
detect a stall on some other CPU or task. This commit therefore adds
checks for self-detected stalls.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# fc91cbab 06-Dec-2015 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Don't keep empty console.log.diags files

Currently, an error-free run produces an empty console.log.diags file.
This can be annoying when using "vi */console.log.diags" to see a full
summary of the errors. This commit therefore removes any empty files
during the analysis process.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# f5a5386b 06-Dec-2015 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Add checks for rcutorture writer starvation

This commit adds checks for rcutorture writer starvation, so that
instances will be added to the test summary.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# 5708c647 01-Dec-2015 Paul E. McKenney <paulmck@kernel.org>

torture: Abbreviate console error dump

Currently, the scripts print a list of warning/bug indicators from the
console.log file. This works well if there are only a few warnings or
bugs, but can be quite annoying if there is a large number. This commit
therefore prints a summary listing the number of each type of warning/bug
indicator, but only if there is at least one such indicator. The full
list is stored in the results directory at console.log.diags, which
makes it easier to find the warning/bugs in the full console.log.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>


# e9408e4f 08-Dec-2014 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Add checks for stall ending before dump start

The current rcutorture scripting checks for actual stalls (via the "Call
Trace:" check), but fails to spot the case where a stall ends just as it
is being detected. This commit therefore adds a check for this case.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# bc51896d 26-Aug-2014 Paul E. McKenney <paulmck@kernel.org>

torture: Check for nul bytes in console output

When starting a new torture run while an old one is still running, both
qemu processes can be outputting to the same console.out file. This can
cause quite a bit of confusion, so this commit checks for this situation,
which is normally indicated by nul bytes in the console output. Yes,
if your new run uses up an exact number of blocks of the file, this
check will be ineffective, but the odds are not bad.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>


# 3327d924 11-Jul-2014 Pranith Kumar <bobby.prani@gmail.com>

rcutorture: Set executable bit and drop bash from Usage

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>


# 1a5e31fb 11-Jul-2014 Pranith Kumar <bobby.prani@gmail.com>

rcutorture: Use bash shell for all the test scripts

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>


# 0e342a87 03-Dec-2013 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Stop tracking FSF's postal address

All of the rcutorture scripts has the usual GPL header, which contains
a long-obsolete postal address for FSF. To avoid the need to track the
FSF office's movements, this commit substitutes the URL where GPL may
be found.

Reported-by: Greg KH <gregkh@linuxfoundation.org>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>


# 6d40cc0c 28-Oct-2013 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Flag errors and warnings with color coding

The output of the rcutorture scripts often requires interpretation, so
this commit simplifies this interpretation by tagging messages as
BUGs (colored red) or WARNINGs (colored yellow).

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>


# c87b9c60 28-Sep-2013 Paul E. McKenney <paulmck@kernel.org>

rcutorture: Add KVM-based test framework

This commit adds the test framework that I used to test RCU under KVM.
This consists of a group of scripts and Kconfig fragments.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>