diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-04-30 04:35:33 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-04-30 04:42:59 +0200 |
commit | 058e297d34a404caaa5ed277de15698d8dc43000 (patch) | |
tree | 0a4cfa547a4cf466f8c746978ff5fe464cbe88ab /kernel/trace/ftrace.c | |
parent | perf, x86, nmi: Move LVT un-masking into irq handlers (diff) | |
download | linux-058e297d34a404caaa5ed277de15698d8dc43000.tar.xz linux-058e297d34a404caaa5ed277de15698d8dc43000.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | kernel/trace/ftrace.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index ee24fa1935ac..666880d051ef 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; } |