From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Oleg Nesterov <oleg@redhat.com>,
kbuild test robot <fengguang.wu@intel.com>,
Chen Gang <gang.chen@asianux.com>
Subject: [PATCH 10/14] tracing: Add ref_data to function and fgraph tracer structs
Date: Mon, 22 Jul 2013 10:19:57 -0400 [thread overview]
Message-ID: <20130722142125.895359522@goodmis.org> (raw)
In-Reply-To: 20130722141947.972915744@goodmis.org
[-- Attachment #1: 0010-tracing-Add-ref_data-to-function-and-fgraph-tracer-s.patch --]
[-- Type: text/plain, Size: 2903 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
The selftest for function and function graph tracers are defined as
__init, as they are only executed at boot up. The "tracer" structs
that are associated to those tracers are not setup as __init as they
are used after boot. To stop mismatch warnings, those structures
need to be annotated with __ref_data.
Currently, the tracer structures are defined to __read_mostly, as they
do not really change. But in the future they should be converted to
consts, but that will take a little work because they have a "next"
pointer that gets updated when they are registered. That will have to
wait till the next major release.
Link: http://lkml.kernel.org/r/1373596735.17876.84.camel@gandalf.local.home
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.h | 9 +++++++++
kernel/trace/trace_functions.c | 2 +-
kernel/trace/trace_functions_graph.c | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 4a4f6e1..57b7bb0 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -680,6 +680,15 @@ extern int trace_selftest_startup_sched_switch(struct tracer *trace,
struct trace_array *tr);
extern int trace_selftest_startup_branch(struct tracer *trace,
struct trace_array *tr);
+/*
+ * Tracer data references selftest functions that only occur
+ * on boot up. These can be __init functions. Thus, when selftests
+ * are enabled, then the tracers need to reference __init functions.
+ */
+#define __tracer_data __refdata
+#else
+/* Tracers are seldom changed. Optimize when selftests are disabled. */
+#define __tracer_data __read_mostly
#endif /* CONFIG_FTRACE_STARTUP_TEST */
extern void *head_page(struct trace_array_cpu *data);
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index b863f93..38fe148 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -199,7 +199,7 @@ static int func_set_flag(u32 old_flags, u32 bit, int set)
return 0;
}
-static struct tracer function_trace __read_mostly =
+static struct tracer function_trace __tracer_data =
{
.name = "function",
.init = function_trace_init,
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index d56ae9b..b5c0924 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -1448,7 +1448,7 @@ static struct trace_event graph_trace_ret_event = {
.funcs = &graph_functions
};
-static struct tracer graph_trace __read_mostly = {
+static struct tracer graph_trace __tracer_data = {
.name = "function_graph",
.open = graph_trace_open,
.pipe_open = graph_trace_open,
--
1.7.10.4
next prev parent reply other threads:[~2013-07-22 14:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 14:19 [PATCH 00/14] [GIT PULL] tracing: fixes, clean ups and optimizations Steven Rostedt
2013-07-22 14:19 ` [PATCH 01/14] tracing: Use correct config guard CONFIG_STACK_TRACER Steven Rostedt
2013-07-22 14:19 ` [PATCH 02/14] tracing: Use trace_seq_puts()/trace_seq_putc() where possible Steven Rostedt
2013-07-22 14:19 ` [PATCH 03/14] tracing: Typo fix on ring buffer comments Steven Rostedt
2013-07-22 14:19 ` [PATCH 04/14] tracing/function: Avoid perf_trace_buf_*() if event_function.perf_events is empty Steven Rostedt
2013-07-22 14:19 ` [PATCH 05/14] tracing/syscall: Avoid perf_trace_buf_*() if sys_data->perf_events " Steven Rostedt
2013-07-22 14:19 ` [PATCH 06/14] tracing/perf: Move the PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare() Steven Rostedt
2013-07-22 14:19 ` [PATCH 07/14] tracing/kprobe: Wait for disabling all running kprobe handlers Steven Rostedt
2013-07-22 14:19 ` [PATCH 08/14] tracing: Fix error handling to ensure instances can always be removed Steven Rostedt
2013-07-22 14:19 ` [PATCH 09/14] tracing: Miscellaneous fixes for trace_array ref counting Steven Rostedt
2013-07-22 14:19 ` Steven Rostedt [this message]
2013-07-22 14:19 ` [PATCH 11/14] tracing: Simplify the iteration logic in f_start/f_next Steven Rostedt
2013-07-22 14:19 ` [PATCH 12/14] tracing: Do not (ab)use trace_seq in event_id_read() Steven Rostedt
2013-07-22 14:20 ` [PATCH 13/14] tracing: Kill trace_array->waiter Steven Rostedt
2013-07-22 14:20 ` [PATCH 14/14] tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open() 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=20130722142125.895359522@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=gang.chen@asianux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.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