compat: add some tracing backport work
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Tue, 20 Mar 2012 03:20:50 +0000 (20:20 -0700)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Tue, 20 Mar 2012 03:20:50 +0000 (20:20 -0700)
Its not really easy to backport the tracing stuff, but
lets give it a shot. We should simply review how many
subsystems we want tracing for and for what target kernels
we want that enabled for. It doesn't make sense to
backport tracing if we won't have much users.

For now add some code that at least does not break building.

Trying kernel                  3.3.0-030300rc2-generic  [OK]
Trying kernel                     3.2.2-030202-generic  [OK]
Trying kernel                    3.1.10-030110-generic  [OK]
Trying kernel                    3.0.18-030018-generic  [OK]
Trying kernel                  2.6.39-02063904-generic  [OK]
Trying kernel                        2.6.38-13-generic  [OK]
Trying kernel                  2.6.38-02063808-generic  [OK]
Trying kernel                  2.6.37-02063706-generic  [OK]
Trying kernel                  2.6.36-02063604-generic  [OK]
Trying kernel                  2.6.35-02063512-generic  [OK]
Trying kernel                  2.6.34-02063410-generic  [OK]
Trying kernel                  2.6.33-02063305-generic  [OK]
Trying kernel                  2.6.32-02063255-generic  [OK]
Trying kernel                        2.6.31-22-generic  [OK]
Trying kernel                  2.6.31-02063113-generic  [OK]
Trying kernel                  2.6.30-02063010-generic  [OK]
Trying kernel                  2.6.29-02062906-generic  [OK]
Trying kernel                  2.6.28-02062810-generic  [OK]
Trying kernel                    2.6.27-020627-generic  [OK]
Trying kernel                    2.6.26-020626-generic  [OK]
Trying kernel                    2.6.25-020625-generic  [OK]
Trying kernel                    2.6.24-020624-generic  [OK]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
include/linux/tracepoint.h

index 9f5add1..a5bd743 100644 (file)
@@ -4,7 +4,47 @@
 #include <linux/version.h>
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
+
 #include_next <linux/tracepoint.h>
+
+/* Backports f42c85e7 */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
+#undef TP_STRUCT__entry
+#define TP_STRUCT__entry(args...) args
+#endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+/* Backports 091ad365, a rename */
+#define DECLARE_EVENT_CLASS TRACE_EVENT_TEMPLATE
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
+#define TP_PROTO TPPROTO
+#define TP_ARGS TPARGS
+#define TP_FMT TPFMT
+#define TP_RAW_FMT TPRAWFMT
+#endif
+
+#endif
+
+#else /* just disable tracing */
+
+/* Disable all tracing */
+#undef TRACE_EVENT
+#define TRACE_EVENT(name, proto, ...) \
+static inline void trace_ ## name(proto) {}
+#undef DECLARE_EVENT_CLASS
+#define DECLARE_EVENT_CLASS(...)
+#undef DEFINE_EVENT
+#define DEFINE_EVENT(evt_class, name, proto, ...) \
+static inline void trace_ ## name(proto) {}
+
+#define TP_PROTO(args...)  args
+#define TP_ARGS(args...)   args
+#define TP_CONDITION(args...)      args
+
+struct tracepoint_iter {
+};
+
 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */
 
 #endif /* _COMPAT_LINUX_TRACEPOINT_H */