Skip to content

Commit 7cb2e3e

Browse files
Steven Rostedtrostedt
authored andcommitted
tracing: add comments to explain TRACE_EVENT out of protection
The commit: commit 5ac35da Author: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> tracing/events: fix the include file dependencies Moved the TRACE_EVENT out of the ifdef protection of tracepoints.h but uses the define of TRACE_EVENT itself as protection. This patch adds comments to explain why. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 5ac35da commit 7cb2e3e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎include/linux/tracepoint.h‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,15 @@ static inline void tracepoint_synchronize_unregister(void)
180180
}
181181

182182
#define PARAMS(args...) args
183-
#endif
183+
184+
#endif /* _LINUX_TRACEPOINT_H */
185+
186+
/*
187+
* Note: we keep the TRACE_EVENT outside the include file ifdef protection.
188+
* This is due to the way trace events work. If a file includes two
189+
* trace event headers under one "CREATE_TRACE_POINTS" the first include
190+
* will override the TRACE_EVENT and break the second include.
191+
*/
184192

185193
#ifndef TRACE_EVENT
186194
/*
@@ -287,4 +295,5 @@ static inline void tracepoint_synchronize_unregister(void)
287295

288296
#define TRACE_EVENT(name, proto, args, struct, assign, print) \
289297
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
290-
#endif
298+
299+
#endif /* ifdef TRACE_EVENT (see note above) */

0 commit comments

Comments
 (0)