trace-cmd record: Disable all tracing after recording data

The latency tracers (preemptirqsoff, wakeup_rt, etc) just take a snapshot at
the end of the tracing, and this is done in the record_data() function. But
if "keep" is not set, tracecmd_disable_all_tracing() is called before then.
That function will clear the trace output and with it, the snapshot that
should be recorded for the latency tracers.

As writing to the trace buffer is already disabled by the call to
tracecmd_disable_tracing() above the tracecmd_disable_all_tracing(), there's
no reason to disable all tracing before the record_data() is called. Simply
move the disable tracing after that, and then the information about the
latency tracers snapshot will be stored in the trace.dat file.

Link: https://lore.kernel.org/linux-trace-devel/20210224130314.2a515592@gandalf.local.home

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed