summaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-07-05 10:04:34 -0400
committerSteven Rostedt <rostedt@goodmis.org>2016-07-05 10:47:03 -0400
commit501c2375253c0795048f48368e0b3e8b2f6646dc (patch)
tree8e7ce373ed65d81769a5d18dfa899378c8e917be /kernel/trace/ftrace.c
parent7fa8b7171a638ad896acabd9a17183b75b70aeb4 (diff)
downloadlinux-501c2375253c0795048f48368e0b3e8b2f6646dc.tar.gz
linux-501c2375253c0795048f48368e0b3e8b2f6646dc.tar.bz2
linux-501c2375253c0795048f48368e0b3e8b2f6646dc.zip
ftrace: Move toplevel init out of ftrace_init_tracefs()
Commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do") placed ftrace_init_tracefs into the instance creation, and encapsulated the top level updating with an if conditional, as the top level only gets updated at boot up. Unfortunately, this triggers section mismatch errors as the init functions are called from a function that can be called later, and the section mismatch logic is unaware of the if conditional that would prevent it from happening at run time. To make everyone happy, create a separate ftrace_init_tracefs_toplevel() routine that only gets called by init functions, and this will be what calls other init functions for the toplevel directory. Link: http://lkml.kernel.org/r/20160704102139.19cbc0d9@gandalf.local.home Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Fixes: 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do") Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 8b488f4dd8e8..84752c8e28b5 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5539,16 +5539,20 @@ static const struct file_operations ftrace_pid_fops = {
void ftrace_init_tracefs(struct trace_array *tr, struct dentry *d_tracer)
{
- /* Only the top level directory has the dyn_tracefs and profile */
- if (tr->flags & TRACE_ARRAY_FL_GLOBAL) {
- ftrace_init_dyn_tracefs(d_tracer);
- ftrace_profile_tracefs(d_tracer);
- }
-
trace_create_file("set_ftrace_pid", 0644, d_tracer,
tr, &ftrace_pid_fops);
}
+void __init ftrace_init_tracefs_toplevel(struct trace_array *tr,
+ struct dentry *d_tracer)
+{
+ /* Only the top level directory has the dyn_tracefs and profile */
+ WARN_ON(!(tr->flags & TRACE_ARRAY_FL_GLOBAL));
+
+ ftrace_init_dyn_tracefs(d_tracer);
+ ftrace_profile_tracefs(d_tracer);
+}
+
/**
* ftrace_kill - kill ftrace
*