Skip to content

Commit 3a9f987

Browse files
Steven Rostedtrostedt
authored andcommitted
tracing: Include module.h in define_trace.h
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 <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent cb600d2 commit 3a9f987

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/trace/define_trace.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
#undef CREATE_TRACE_POINTS
2222

2323
#include <linux/stringify.h>
24+
/*
25+
* module.h includes tracepoints, and because ftrace.h
26+
* pulls in module.h:
27+
* trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
28+
* linux/ftrace.h -> linux/module.h
29+
* we must include module.h here before we play with any of
30+
* the TRACE_EVENT() macros, otherwise the tracepoints included
31+
* by module.h may break the build.
32+
*/
33+
#include <linux/module.h>
2434

2535
#undef TRACE_EVENT
2636
#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \

0 commit comments

Comments
 (0)