From: Arnd Bergmann <arnd@arndb.de>
To: Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Dmitry Safonov <0x7f454c46@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] ftrace: move function_stats out of __initdata
Date: Mon, 4 Jul 2016 15:09:44 +0200 [thread overview]
Message-ID: <20160704131005.933647-1-arnd@arndb.de> (raw)
Not marking ftrace_init_tracefs() as __init causes a link time warning:
WARNING: vmlinux.o(.text+0xf5fcc): Section mismatch in reference from the function ftrace_init_tracefs() to the (unknown reference) .init.data:(unknown)
The problem here is that ftrace_init_tracefs() now gets called by
init_tracer_tracefs(), which cannot be __init because it is called
post init-time from instance_mkdir(). The function calls to the
init-time ftrace_init_dyn_tracefs() and ftrace_profile_tracefs()
functions apparently only happen for the initial call to
ftrace_init_tracefs(), so we could safely ignore the warning, but
at the same time, it all gets inlined anyway and we may as well
remove the annotations.
The alternative would be restructuring the code so we only call
trace_create_file() from init_tracer_tracefs(), but not the other
init-time functions.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap like events do")
---
kernel/trace/ftrace.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a486d7def6f4..815170769022 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1011,7 +1011,7 @@ static const struct file_operations ftrace_profile_fops = {
};
/* used to initialize the real stat files */
-static struct tracer_stat function_stats __initdata = {
+static struct tracer_stat function_stats = {
.name = "functions",
.stat_start = function_stat_start,
.stat_next = function_stat_next,
@@ -1020,7 +1020,7 @@ static struct tracer_stat function_stats __initdata = {
.stat_show = function_stat_show
};
-static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
+static void ftrace_profile_tracefs(struct dentry *d_tracer)
{
struct ftrace_profile_stat *stat;
struct dentry *entry;
@@ -1061,7 +1061,7 @@ static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
}
#else /* CONFIG_FUNCTION_PROFILER */
-static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
+static void ftrace_profile_tracefs(struct dentry *d_tracer)
{
}
#endif /* CONFIG_FUNCTION_PROFILER */
@@ -4797,7 +4797,7 @@ void ftrace_destroy_filter_files(struct ftrace_ops *ops)
mutex_unlock(&ftrace_lock);
}
-static __init int ftrace_init_dyn_tracefs(struct dentry *d_tracer)
+static int ftrace_init_dyn_tracefs(struct dentry *d_tracer)
{
trace_create_file("available_filter_functions", 0444,
--
2.9.0
next reply other threads:[~2016-07-04 13:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 13:09 Arnd Bergmann [this message]
2016-07-04 14:21 ` [PATCH] ftrace: move function_stats out of __initdata Steven Rostedt
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=20160704131005.933647-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=0x7f454c46@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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