aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tracepoint.h
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2012-09-05 02:23:06 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-09-12 10:20:14 -0400
commit7ece55a4a3a04abe37118b1d4fb0b702eeb1de4c (patch)
treeef19b2666aae3850fc70741529d4090c31698c7f /include/linux/tracepoint.h
parent55d512e245bc7699a8800e23df1a24195dd08217 (diff)
trace: Don't declare trace_*_rcuidle functions in modules
Tracepoints declare a static inline trace_*_rcuidle variant of the trace function, to support safely generating trace events from the idle loop. Module code never actually uses that variant of trace functions, because modules don't run code that needs tracing with RCU idled. However, the declaration of those otherwise unused functions causes the module to reference rcu_idle_exit and rcu_idle_enter, which RCU does not export to modules. To avoid this, don't generate trace_*_rcuidle functions for tracepoints declared in module code. Link: http://lkml.kernel.org/r/20120905062306.GA14756@leaf Reported-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/tracepoint.h')
-rw-r--r--include/linux/tracepoint.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 802de56c41e8..2f322c38bd4d 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -136,6 +136,22 @@ static inline void tracepoint_synchronize_unregister(void)
136 postrcu; \ 136 postrcu; \
137 } while (0) 137 } while (0)
138 138
139#ifndef MODULE
140#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \
141 static inline void trace_##name##_rcuidle(proto) \
142 { \
143 if (static_key_false(&__tracepoint_##name.key)) \
144 __DO_TRACE(&__tracepoint_##name, \
145 TP_PROTO(data_proto), \
146 TP_ARGS(data_args), \
147 TP_CONDITION(cond), \
148 rcu_idle_exit(), \
149 rcu_idle_enter()); \
150 }
151#else
152#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args)
153#endif
154
139/* 155/*
140 * Make sure the alignment of the structure in the __tracepoints section will 156 * Make sure the alignment of the structure in the __tracepoints section will
141 * not add unwanted padding between the beginning of the section and the 157 * not add unwanted padding between the beginning of the section and the
@@ -151,16 +167,8 @@ static inline void tracepoint_synchronize_unregister(void)
151 TP_ARGS(data_args), \ 167 TP_ARGS(data_args), \
152 TP_CONDITION(cond),,); \ 168 TP_CONDITION(cond),,); \
153 } \ 169 } \
154 static inline void trace_##name##_rcuidle(proto) \ 170 __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \
155 { \ 171 PARAMS(cond), PARAMS(data_proto), PARAMS(data_args)) \
156 if (static_key_false(&__tracepoint_##name.key)) \
157 __DO_TRACE(&__tracepoint_##name, \
158 TP_PROTO(data_proto), \
159 TP_ARGS(data_args), \
160 TP_CONDITION(cond), \
161 rcu_idle_exit(), \
162 rcu_idle_enter()); \
163 } \
164 static inline int \ 172 static inline int \
165 register_trace_##name(void (*probe)(data_proto), void *data) \ 173 register_trace_##name(void (*probe)(data_proto), void *data) \
166 { \ 174 { \