trace-cmd split: Enable support for buffer selection
The 'trace-cmd split' command conserves all buffers/instances
of the input .dat file. Add support to select the instances to
keep:
- '--top' to keep the top instance
- '-b' top rename the top instance. Must follow '--top'.
- '-B buffer' to keep a buffer/instance
- t top promote a buffer to the top instance.
Must follow '-B'.
For example, with a trace recorded with:
$ trace-cmd record -e sched_wakeup -B switch_instance \
-e sched_switch
Creating a test.dat file containing the top instance and
the switch_instance:
$ trace-cmd split --top -B switch_instance -o test.dat
Creating a test.dat file containing the switch_instance as
the top instance, and the initial top instance as an instance
named 'old_top':
$ trace-cmd split --top -b old_top -B switch_instance -t \
-o test.dat
Also update the trace-usage.c and the relevant documentation
for the new options.
Link: https://lore.kernel.org/linux-trace-devel/20240222165418.2153026-2-pierre.gondois@arm.com
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
3 files changed