diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-01-24 13:22:31 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-01-24 14:59:21 -0500 |
commit | a2c286005b9b582ba54735fdc0edf03df8892cc6 (patch) | |
tree | 3b60dbe8287782be6f8dad4ffecac11ad5dce9d1 | |
parent | 3b6096fc8d2865fae0deafc2723aec8c7742342e (diff) | |
download | trace-cmd-a2c286005b9b582ba54735fdc0edf03df8892cc6.tar.gz |
trace-cmd report: Allow for multiple files without having -i
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.
Link: https://lore.kernel.org/linux-trace-devel/20240124132231.638e148a@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | Documentation/trace-cmd/trace-cmd-report.1.txt | 2 | ||||
-rw-r--r-- | tracecmd/trace-read.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/trace-cmd/trace-cmd-report.1.txt b/Documentation/trace-cmd/trace-cmd-report.1.txt index ddbde811..62fba1e5 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 1dea54c4..beaf97a8 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) { |