From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
Subject: [PATCH] trace-cmd record: Disable all tracing after recording data
Date: Wed, 24 Feb 2021 13:03:14 -0500 [thread overview]
Message-ID: <20210224130314.2a515592@gandalf.local.home> (raw)
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
reply other threads:[~2021-02-24 18:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210224130314.2a515592@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=Viktor.Rosendahl@bmw.de \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).