mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL][v2.6.39] ftrace: Only update the function code on write to filter files
@ 2011-04-30  2:57 Steven Rostedt
  2011-05-01 17:09 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2011-04-30  2:57 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, stable


Ingo,

Please pull the latest tip/perf/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/urgent


Steven Rostedt (1):
      ftrace: Only update the function code on write to filter files

----
 kernel/trace/ftrace.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---------------------------
commit 058e297d34a404caaa5ed277de15698d8dc43000
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Fri Apr 29 22:35:33 2011 -0400

    ftrace: Only update the function code on write to filter files
    
    If function tracing is enabled, a read of the filter files will
    cause the call to stop_machine to update the function trace sites.
    It should only call stop_machine on write.
    
    Cc: stable@kernel.org
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index ee24fa1..666880d 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2413,14 +2413,16 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable)
 		ftrace_match_records(parser->buffer, parser->idx, enable);
 	}
 
-	mutex_lock(&ftrace_lock);
-	if (ftrace_start_up && ftrace_enabled)
-		ftrace_run_update_code(FTRACE_ENABLE_CALLS);
-	mutex_unlock(&ftrace_lock);
-
 	trace_parser_put(parser);
 	kfree(iter);
 
+	if (file->f_mode & FMODE_WRITE) {
+		mutex_lock(&ftrace_lock);
+		if (ftrace_start_up && ftrace_enabled)
+			ftrace_run_update_code(FTRACE_ENABLE_CALLS);
+		mutex_unlock(&ftrace_lock);
+	}
+
 	mutex_unlock(&ftrace_regex_lock);
 	return 0;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-01 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-30  2:57 [GIT PULL][v2.6.39] ftrace: Only update the function code on write to filter files Steven Rostedt
2011-05-01 17:09 ` Ingo Molnar

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®