diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-07-12 13:01:49 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-09-07 19:18:14 -0400 |
commit | a8a29b3b7b18251c4e3ffce501f25ae868302a75 (patch) | |
tree | c1a38c47ae43dc8f89e17d32a3c19434470cd78e /kernel | |
parent | 85b39d305bfe809a11ff2770d380be3e2465beec (diff) |
rcu: Define tracepoint strings only if CONFIG_TRACING is set
Commit f7f7bac9cb1c ("rcu: Have the RCU tracepoints use the tracepoint_string
infrastructure") unconditionally populates the __tracepoint_str input section,
but this section is not assigned an output section if CONFIG_TRACING is not set.
This results in the __tracepoint_str turning up in unexpected places, i.e.,
after _edata.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcu/tree.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 2719978ea018..dc52dc3b8c3e 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -79,9 +79,18 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS]; | |||
79 | * the tracing userspace tools to be able to decipher the string | 79 | * the tracing userspace tools to be able to decipher the string |
80 | * address to the matching string. | 80 | * address to the matching string. |
81 | */ | 81 | */ |
82 | #define RCU_STATE_INITIALIZER(sname, sabbr, cr) \ | 82 | #ifdef CONFIG_TRACING |
83 | # define DEFINE_RCU_TPS(sname) \ | ||
83 | static char sname##_varname[] = #sname; \ | 84 | static char sname##_varname[] = #sname; \ |
84 | static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; \ | 85 | static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; |
86 | # define RCU_STATE_NAME(sname) sname##_varname | ||
87 | #else | ||
88 | # define DEFINE_RCU_TPS(sname) | ||
89 | # define RCU_STATE_NAME(sname) __stringify(sname) | ||
90 | #endif | ||
91 | |||
92 | #define RCU_STATE_INITIALIZER(sname, sabbr, cr) \ | ||
93 | DEFINE_RCU_TPS(sname) \ | ||
85 | struct rcu_state sname##_state = { \ | 94 | struct rcu_state sname##_state = { \ |
86 | .level = { &sname##_state.node[0] }, \ | 95 | .level = { &sname##_state.node[0] }, \ |
87 | .call = cr, \ | 96 | .call = cr, \ |
@@ -93,7 +102,7 @@ struct rcu_state sname##_state = { \ | |||
93 | .orphan_donetail = &sname##_state.orphan_donelist, \ | 102 | .orphan_donetail = &sname##_state.orphan_donelist, \ |
94 | .barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \ | 103 | .barrier_mutex = __MUTEX_INITIALIZER(sname##_state.barrier_mutex), \ |
95 | .onoff_mutex = __MUTEX_INITIALIZER(sname##_state.onoff_mutex), \ | 104 | .onoff_mutex = __MUTEX_INITIALIZER(sname##_state.onoff_mutex), \ |
96 | .name = sname##_varname, \ | 105 | .name = RCU_STATE_NAME(sname), \ |
97 | .abbr = sabbr, \ | 106 | .abbr = sabbr, \ |
98 | }; \ | 107 | }; \ |
99 | DEFINE_PER_CPU(struct rcu_data, sname##_data) | 108 | DEFINE_PER_CPU(struct rcu_data, sname##_data) |