diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-07-18 14:41:51 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-07-18 21:31:31 -0400 |
commit | 8f768993394a8c0d3801033c11fd86ce8c88dcac (patch) | |
tree | 67321d3042a7561729c55763190ffde07336904a /kernel | |
parent | f77d09a384676bde6445413949d9d2c508ff3e62 (diff) |
tracing: Add ref_data to function and fgraph tracer structs
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.h | 9 | ||||
-rw-r--r-- | kernel/trace/trace_functions.c | 2 | ||||
-rw-r--r-- | 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 4a4f6e1828b6..57b7bb0d39b7 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, | |||
680 | struct trace_array *tr); | 680 | struct trace_array *tr); |
681 | extern int trace_selftest_startup_branch(struct tracer *trace, | 681 | extern int trace_selftest_startup_branch(struct tracer *trace, |
682 | struct trace_array *tr); | 682 | struct trace_array *tr); |
683 | /* | ||
684 | * Tracer data references selftest functions that only occur | ||
685 | * on boot up. These can be __init functions. Thus, when selftests | ||
686 | * are enabled, then the tracers need to reference __init functions. | ||
687 | */ | ||
688 | #define __tracer_data __refdata | ||
689 | #else | ||
690 | /* Tracers are seldom changed. Optimize when selftests are disabled. */ | ||
691 | #define __tracer_data __read_mostly | ||
683 | #endif /* CONFIG_FTRACE_STARTUP_TEST */ | 692 | #endif /* CONFIG_FTRACE_STARTUP_TEST */ |
684 | 693 | ||
685 | extern void *head_page(struct trace_array_cpu *data); | 694 | extern void *head_page(struct trace_array_cpu *data); |
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index b863f93b30f3..38fe1483c508 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) | |||
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
201 | 201 | ||
202 | static struct tracer function_trace __read_mostly = | 202 | static struct tracer function_trace __tracer_data = |
203 | { | 203 | { |
204 | .name = "function", | 204 | .name = "function", |
205 | .init = function_trace_init, | 205 | .init = function_trace_init, |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index d56ae9bae00b..b5c09242683d 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 = { | |||
1448 | .funcs = &graph_functions | 1448 | .funcs = &graph_functions |
1449 | }; | 1449 | }; |
1450 | 1450 | ||
1451 | static struct tracer graph_trace __read_mostly = { | 1451 | static struct tracer graph_trace __tracer_data = { |
1452 | .name = "function_graph", | 1452 | .name = "function_graph", |
1453 | .open = graph_trace_open, | 1453 | .open = graph_trace_open, |
1454 | .pipe_open = graph_trace_open, | 1454 | .pipe_open = graph_trace_open, |