rcutorture: Copy out ftrace into its own console file
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Tue, 15 Aug 2023 19:09:49 +0000 (19:09 +0000)
committerFrederic Weisbecker <frederic@kernel.org>
Sun, 24 Sep 2023 15:24:01 +0000 (17:24 +0200)
commitfcc7a329a7bfafe732586d876f16be5918b2b0e5
tree32b66a07e1ebbeefb6933e1f43368573f8940f92
parente3bdaefbccbd27b1829414604456611928a5e291
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>
tools/testing/selftests/rcutorture/bin/functions.sh [changed mode: 0644->0755]
tools/testing/selftests/rcutorture/bin/parse-console.sh