From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd report: Allow for multiple files without having -i
Date: Wed, 24 Jan 2024 13:22:31 -0500 [thread overview]
Message-ID: <20240124132231.638e148a@gandalf.local.home> (raw)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
If trace-cmd report is called with a single file that is not specified by
the -i option, it will report it. But if it is called with multiple files,
it will only report the first one. Allow all the trace.dat files at the
end of options to be considered files to read.
That is, currently if you have:
trace-cmd record -e sched sleep 100
trace-cmd split -r -m 100 -o trace-split.dat
trace-cmd report trace-split.dat.*
It will only show the report of trace-split.dat.0001 and not the rest. To
get the rest, each one would need to be included with -i. Instead, allow
them all to be reported with the above command.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
Documentation/trace-cmd/trace-cmd-report.1.txt | 2 +-
tracecmd/trace-read.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/trace-cmd/trace-cmd-report.1.txt b/Documentation/trace-cmd/trace-cmd-report.1.txt
index ddbde811427e..62fba1e5b381 100644
--- a/Documentation/trace-cmd/trace-cmd-report.1.txt
+++ b/Documentation/trace-cmd/trace-cmd-report.1.txt
@@ -7,7 +7,7 @@ trace-cmd-report - show in ASCII a trace created by trace-cmd record
SYNOPSIS
--------
-*trace-cmd report* ['OPTIONS'] ['input-file']
+*trace-cmd report* ['OPTIONS'] ['input-file' ['input-file' ...]]
DESCRIPTION
-----------
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 1dea54c44b38..beaf97a8c570 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -1806,6 +1806,10 @@ void trace_report (int argc, char **argv)
usage(argv);
input_file = argv[optind + 1];
add_first_input(input_file, tsoffset);
+ for (int i = optind + 2; i < argc; i++) {
+ multi_inputs++;
+ add_input(argv[i]);
+ }
}
if (!multi_inputs) {
--
2.43.0
reply other threads:[~2024-01-24 18:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240124132231.638e148a@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.