linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v4 5/6] trace-cmd: Fix "trace-cmd reset" command to restore the default value of set_event_pid
Date: Mon, 11 Mar 2019 10:33:38 +0200	[thread overview]
Message-ID: <20190311083339.21581-6-tstoyanov@vmware.com> (raw)
In-Reply-To: <20190311083339.21581-1-tstoyanov@vmware.com>

The "trace-cmd reset" command should restore ftrace to its default state.
This patch sets "tracing/set_event_pid" to an empty string,
when the "trace-cmd reset" command is executed.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
---
 tracecmd/trace-record.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index a398723..bdf0c02 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3796,6 +3796,12 @@ static void reset_clock(void)
 		write_instance_file(instance, "trace_clock", "local", "clock");
 }
 
+static void reset_event_pid(void)
+{
+	add_event_pid("");
+}
+
+
 static void clear_triggers(void)
 {
 	struct buffer_instance *instance;
@@ -4499,6 +4505,7 @@ void trace_reset(int argc, char **argv)
 	clear_triggers();
 	/* set clock to "local" */
 	reset_clock();
+	reset_event_pid();
 	tracecmd_remove_instances();
 	clear_func_filters();
 	/* restore tracing_on to 1 */
-- 
2.20.1


  parent reply	other threads:[~2019-03-11  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  8:33 [PATCH v4 0/6] trace-cmd reset fixes Tzvetomir Stoyanov
2019-03-11  8:33 ` [PATCH v4 1/6] trace-cmd: Fix "trace-cmd reset" command to restore "tracng_on" Tzvetomir Stoyanov
2019-03-11  8:33 ` [PATCH v4 2/6] trace-cmd: Fix "trace-cmd reset -a -d" segfault Tzvetomir Stoyanov
2019-03-11  8:33 ` [PATCH v4 3/6] trace-cmd: Fix "trace-cmd reset" command to restore default clock Tzvetomir Stoyanov
2019-03-11  8:33 ` [PATCH v4 4/6] trace-cmd: Reafctored add_event_pid()to utilize write_instance_file() Tzvetomir Stoyanov
2019-03-11  8:33 ` Tzvetomir Stoyanov [this message]
2019-03-11  8:33 ` [PATCH v4 6/6] trace-cmd: Reafctored reset_max_latency() to " Tzvetomir Stoyanov
2019-03-13  1:28   ` Steven Rostedt
2019-03-11 13:02 ` [PATCH v4 0/6] trace-cmd reset fixes Slavomir Kaslev

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=20190311083339.21581-6-tstoyanov@vmware.com \
    --to=tstoyanov@vmware.com \
    --cc=linux-trace-devel@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;
as well as URLs for NNTP newsgroup(s).