1 #ifndef _COMPAT_LINUX_TRACEPOINT_H
2 #define _COMPAT_LINUX_TRACEPOINT_H 1
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32))
8 * Disable all tracing for older kernels
9 * < 2.6.27 had no tracing
10 * 2.6.27 had broken tracing
11 * 2.6.28-2.6.32 didn't have anything like DECLARE_EVENT_CLASS
12 * and faking it would be extremely difficult
14 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28))
16 * For 2.6.28+ include the original tracepoint.h but override
17 * the defines new code uses to disable tracing completely.
19 #include_next <linux/tracepoint.h>
23 #define TRACE_EVENT(name, proto, ...) \
24 static inline void trace_ ## name(proto) {}
25 #undef DECLARE_EVENT_CLASS
26 #define DECLARE_EVENT_CLASS(...)
28 #define DEFINE_EVENT(evt_class, name, proto, ...) \
29 static inline void trace_ ## name(proto) {}
31 #define TP_PROTO(args...) args
32 #define TP_ARGS(args...) args
33 #define TP_CONDITION(args...) args
36 /* since 2.6.33, tracing hasn't changed, so just include the kernel's file */
37 #include_next <linux/tracepoint.h>
39 #endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)) */
41 #endif /* _COMPAT_LINUX_TRACEPOINT_H */