Skip to content

Commit

Permalink
tracing: Include module.h in define_trace.h
Browse files Browse the repository at this point in the history
While doing some developing, Peter Zijlstra and I have found
that if a CREATE_TRACE_POINTS include is done before module.h
is included, it can break the build.

We have been lucky so far that this has not broke the build
since module.h is included in almost everything.

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 7, 2011
1 parent cb600d2 commit 3a9f987
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/trace/define_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
#undef CREATE_TRACE_POINTS

#include <linux/stringify.h>
/*
* module.h includes tracepoints, and because ftrace.h
* pulls in module.h:
* trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
* linux/ftrace.h -> linux/module.h
* we must include module.h here before we play with any of
* the TRACE_EVENT() macros, otherwise the tracepoints included
* by module.h may break the build.
*/
#include <linux/module.h>

#undef TRACE_EVENT
#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
Expand Down

0 comments on commit 3a9f987

Please sign in to comment.