linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd record: Disable all tracing after recording data
@ 2021-02-24 18:03 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-02-24 18:03 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: Viktor Rosendahl

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tracecmd/trace-record.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index efd96d27..f1a48045 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -6363,9 +6363,6 @@ static void record_trace(int argc, char **argv,
 
 	record_stats();
 
-	if (!keep)
-		tracecmd_disable_all_tracing(0);
-
 	if (!latency)
 		wait_threads();
 
@@ -6375,6 +6372,9 @@ static void record_trace(int argc, char **argv,
 	} else
 		print_stats();
 
+	if (!keep)
+		tracecmd_disable_all_tracing(0);
+
 	destroy_stats();
 	finalize_record_trace(ctx);
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-24 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 18:03 [PATCH] trace-cmd record: Disable all tracing after recording data Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).