Skip to content

Commit

Permalink
tracing: add comments to explain TRACE_EVENT out of protection
Browse files Browse the repository at this point in the history
The commit:
  commit 5ac35da
  Author: Xiao Guangrong <[email protected]>
  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 <[email protected]>
  • Loading branch information
Steven Rostedt authored and rostedt committed Aug 26, 2009
1 parent 5ac35da commit 7cb2e3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/linux/tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ static inline void tracepoint_synchronize_unregister(void)
}

#define PARAMS(args...) args
#endif

#endif /* _LINUX_TRACEPOINT_H */

/*
* Note: we keep the TRACE_EVENT outside the include file ifdef protection.
* This is due to the way trace events work. If a file includes two
* trace event headers under one "CREATE_TRACE_POINTS" the first include
* will override the TRACE_EVENT and break the second include.
*/

#ifndef TRACE_EVENT
/*
Expand Down Expand Up @@ -287,4 +295,5 @@ static inline void tracepoint_synchronize_unregister(void)

#define TRACE_EVENT(name, proto, args, struct, assign, print) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
#endif

#endif /* ifdef TRACE_EVENT (see note above) */

0 comments on commit 7cb2e3e

Please sign in to comment.