On 08/22/2013 04:49:31 PM, Zoltan Kiss wrote:This is to prevent header reinclusion, the second condition makes it possible to include it again from trace/define_trace.h+#if !defined(_TRACE_SUBSYS_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SUBSYS_H
But this makes no sense to me: why is it needed? (I.E. why must it be
block copied into each _user_ of tracepoints?)
I see only one inclusion guard here, the one above. define_trace.h should take effect at only one place, where CREATE_TRACE_POINTS is defined, to create the tracepoints exactly once. However I don't see as well why it should be outside protection. Maybe because the intentional header reinclusion in it?#include <linux/tracepoint.h>
@@ -48,10 +54,16 @@ DECLARE_TRACE(subsys_eventname,
TP_PROTO(int firstarg, struct task_struct *p),
TP_ARGS(firstarg, p));
+#endif /* _TRACE_SUBSYS_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
+
Why? (Both why do you need to #include a header outside a multiple
inclusion guard, and why is the additional header needed at all in
_every_ subsystem trace header?)