[PATCH] trace-cmd record: Disable all tracing after recording data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux