Commit 5ac35daa authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Steven Rostedt

tracing/events: fix the include file dependencies

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: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
LKML-Reference: <4A937F5E.3020802@cn.fujitsu.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 5079f326
...@@ -180,6 +180,7 @@ static inline void tracepoint_synchronize_unregister(void) ...@@ -180,6 +180,7 @@ static inline void tracepoint_synchronize_unregister(void)
} }
#define PARAMS(args...) args #define PARAMS(args...) args
#endif
#ifndef TRACE_EVENT #ifndef TRACE_EVENT
/* /*
...@@ -287,5 +288,3 @@ static inline void tracepoint_synchronize_unregister(void) ...@@ -287,5 +288,3 @@ static inline void tracepoint_synchronize_unregister(void)
#define TRACE_EVENT(name, proto, args, struct, assign, print) \ #define TRACE_EVENT(name, proto, args, struct, assign, print) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
#endif #endif
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <trace/ftrace.h> #include <trace/ftrace.h>
#endif #endif
#undef TRACE_EVENT
#undef TRACE_HEADER_MULTI_READ #undef TRACE_HEADER_MULTI_READ
/* Only undef what we defined in this file */ /* Only undef what we defined in this file */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment