Skip to content

Commit

Permalink
tracing/events: fix the include file dependencies
Browse files Browse the repository at this point in the history
The TRACE_EVENT depends on the include/linux/tracepoint.h first
and include/trace/ftrace.h later, if we include the ftrace.h early,
a building error will occur.

Both define TRACE_EVENT in trace_a.h and trace_b.h, if we include
those in .c file, like this:

#define CREATE_TRACE_POINTS
include <trace/events/trace_a.h>
include <trace/events/trace_b.h>

The above will not work, because the TRACE_EVENT was re-defined by
the previous .h file.

Reported-by: Wei Yongjun <[email protected]>
Signed-off-by: Xiao Guangrong <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
Xiao Guangrong authored and rostedt committed Aug 26, 2009
1 parent 5079f32 commit 5ac35da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/linux/tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ static inline void tracepoint_synchronize_unregister(void)
}

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

#ifndef TRACE_EVENT
/*
Expand Down Expand Up @@ -287,5 +288,3 @@ 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
1 change: 1 addition & 0 deletions include/trace/define_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <trace/ftrace.h>
#endif

#undef TRACE_EVENT
#undef TRACE_HEADER_MULTI_READ

/* Only undef what we defined in this file */
Expand Down

0 comments on commit 5ac35da

Please sign in to comment.