aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 { \