gator: Use for_each_kernel_tracepoint in Linux 3.15
[android-sdk/arm-ds5-gator.git] / driver / gator.h
index 586cd9e742fb14bc2a6d2e8f808fe5539ec95919..58cb0a2a1f3abb0f3ad7c21228faca0aff061716 100644 (file)
@@ -82,13 +82,21 @@ int gatorfs_create_ro_ulong(struct super_block *sb, struct dentry *root,
                register_trace_##probe_name(probe_##probe_name)
 #      define GATOR_UNREGISTER_TRACE(probe_name) \
                unregister_trace_##probe_name(probe_##probe_name)
                register_trace_##probe_name(probe_##probe_name)
 #      define GATOR_UNREGISTER_TRACE(probe_name) \
                unregister_trace_##probe_name(probe_##probe_name)
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
 #      define GATOR_DEFINE_PROBE(probe_name, proto) \
                static void probe_##probe_name(void *data, PARAMS(proto))
 #      define GATOR_REGISTER_TRACE(probe_name) \
                register_trace_##probe_name(probe_##probe_name, NULL)
 #      define GATOR_UNREGISTER_TRACE(probe_name) \
                unregister_trace_##probe_name(probe_##probe_name, NULL)
 #      define GATOR_DEFINE_PROBE(probe_name, proto) \
                static void probe_##probe_name(void *data, PARAMS(proto))
 #      define GATOR_REGISTER_TRACE(probe_name) \
                register_trace_##probe_name(probe_##probe_name, NULL)
 #      define GATOR_UNREGISTER_TRACE(probe_name) \
                unregister_trace_##probe_name(probe_##probe_name, NULL)
+#else
+#      define GATOR_DEFINE_PROBE(probe_name, proto) \
+               extern struct tracepoint *gator_tracepoint_##probe_name; \
+               static void probe_##probe_name(void *data, PARAMS(proto))
+#      define GATOR_REGISTER_TRACE(probe_name) \
+               tracepoint_probe_register(gator_tracepoint_##probe_name, probe_##probe_name, NULL)
+#      define GATOR_UNREGISTER_TRACE(probe_name) \
+               tracepoint_probe_unregister(gator_tracepoint_##probe_name, probe_##probe_name, NULL)
 #endif
 
 /******************************************************************************
 #endif
 
 /******************************************************************************