aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-02-02 09:52:35 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-02-02 09:52:35 -0500
commitf25429715848b51e25e504b759d070396cc20256 (patch)
tree6f860ecc3a87a0f864afd0b811d8613fd69b8593
parentfcd9e061d9ea087a3c869b076217bbd131f5a13f (diff)
trace-cmd: Reset ftrace pid on disable all
Reset the ftrace pid on disable all and also fix the reset of the file to perform a O_TRUNC, otherwise it keeps the previous pids. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/trace-cmd.c b/trace-cmd.c
index 968904f..1365a73 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -273,7 +273,7 @@ static void update_ftrace_pid(const char *pid)
273 if (!path) 273 if (!path)
274 return; 274 return;
275 275
276 fd = open(path, O_WRONLY); 276 fd = open(path, O_WRONLY | O_TRUNC);
277 if (fd < 0) 277 if (fd < 0)
278 return; 278 return;
279 279
@@ -716,6 +716,7 @@ static void disable_all(void)
716 716
717 set_plugin("nop"); 717 set_plugin("nop");
718 update_event("all", "0", 0, '0'); 718 update_event("all", "0", 0, '0');
719 update_ftrace_pid("");
719 720
720 clear_trace(); 721 clear_trace();
721} 722}