mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Asselstine <mark.asselstine@windriver.com>
To: <rostedt@goodmis.org>
Cc: <linux-kernel@vger.kernel.org>, <mark.asselstine@windriver.com>
Subject: [PATCH 3/3] trace-cmd: setting plugin to 'nop' clears data before its recorded
Date: Thu, 5 Apr 2012 15:19:46 -0400	[thread overview]
Message-ID: <1333653586-3379-4-git-send-email-mark.asselstine@windriver.com> (raw)
In-Reply-To: <1333653586-3379-1-git-send-email-mark.asselstine@windriver.com>

commit e09a5db1a929ab668c273b87c4f0a32b81e1c21a
[trace-cmd: Add trace-cmd record --date option]

moved the call to disable_all() in trace_record() from after record_data()
to before it. disable_all() sets 'nop' in 'current_tracer' which has the
side affect of clearing 'trace', thus all the latency tracer reports are
empty/useless. By moving set_plugin() out of disable_all() and rather
calling it after record_data() we still achieve the desired goals of
commit e09a5db1a9 while fixing latency tracing reports.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 trace-record.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/trace-record.c b/trace-record.c
index 1c56fa9..6887874 100644
--- a/trace-record.c
+++ b/trace-record.c
@@ -897,11 +897,10 @@ static void disable_tracing(void)
 	write_tracing_on(0);
 }
 
-static void disable_all(void)
+static void disable_all_but_plugin(void)
 {
 	disable_tracing();
 
-	set_plugin("nop");
 	reset_events();
 
 	/* Force close and reset of ftrace pid file */
@@ -911,6 +910,12 @@ static void disable_all(void)
 	clear_trace();
 }
 
+static void disable_all(void)
+{
+	disable_all_but_plugin();
+	set_plugin("nop");
+}
+
 static void
 update_sched_event(struct event_list **event, const char *file,
 		   const char *pid_filter, const char *field_filter)
@@ -2227,7 +2232,7 @@ void trace_record (int argc, char **argv)
 	}
 
 	if (!keep)
-		disable_all();
+		disable_all_but_plugin();
 
 	printf("Kernel buffer statistics:\n"
 	       "  Note: \"entries\" are the entries left in the kernel ring buffer and are not\n"
@@ -2245,6 +2250,8 @@ void trace_record (int argc, char **argv)
 
 	record_data(date2ts);
 	delete_thread_data();
+	if (!keep)
+		set_plugin("nop");
 
 	if (keep)
 		exit(0);
-- 
1.7.5.4


  parent reply	other threads:[~2012-04-05 19:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 19:19 [PATCH 0/3] trace-cmd fixes for latency tracing record and report Mark Asselstine
2012-04-05 19:19 ` [PATCH 1/3] trace-cmd: add checks for invalid pointers to fix segfaults Mark Asselstine
2012-04-05 19:19 ` [PATCH 2/3] trace-cmd: don't call stop_threads() if doing latency tracing Mark Asselstine
2012-04-05 19:19 ` Mark Asselstine [this message]
2012-04-05 21:37   ` [PATCH 3/3] trace-cmd: setting plugin to 'nop' clears data before its recorded Steven Rostedt
2012-04-06 12:06     ` Mark Asselstine
2012-04-06 12:24       ` Steven Rostedt
2012-04-08 15:38         ` [PATCH v2 3/3] trace-cmd: setting plugin to 'nop' clears data before it's recorded Mark Asselstine
2012-05-23  9:33           ` Steven Rostedt
2012-05-23 13:26             ` Mark Asselstine

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=1333653586-3379-4-git-send-email-mark.asselstine@windriver.com \
    --to=mark.asselstine@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®