[lttng-dev] [PATCH lttng-modules] Fix: probe_unregister for v4.11.8-rt5

Michael Jeanson mjeanson at efficios.com
Wed Jul 12 15:01:19 UTC 2017


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 lttng-tracepoint.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lttng-tracepoint.c b/lttng-tracepoint.c
index 7a50dd2..3d70ca0 100644
--- a/lttng-tracepoint.c
+++ b/lttng-tracepoint.c
@@ -28,6 +28,7 @@
 #include <linux/jhash.h>
 #include <linux/module.h>
 
+#include <lttng-kernel-version.h>
 #include <lttng-tracepoint.h>
 #include <wrapper/list.h>
 
@@ -201,6 +202,22 @@ end:
 	return ret;
 }
 
+#if (LTTNG_RT_KERNEL_RANGE(4,11,8,5, 4,12,0,0))
+static
+int lttng_tracepoint_probe_unregister_static(struct tracepoint *tp,
+		void *probe, void *data)
+{
+	return tracepoint_probe_unregister(tp, probe, data, false);
+}
+#else
+static
+int lttng_tracepoint_probe_unregister_static(struct tracepoint *tp,
+		void *probe, void *data)
+{
+	return tracepoint_probe_unregister(tp, probe, data);
+}
+#endif
+
 int lttng_tracepoint_probe_unregister(const char *name, void *probe, void *data)
 {
 	struct tracepoint_entry *e;
@@ -217,7 +234,7 @@ int lttng_tracepoint_probe_unregister(const char *name, void *probe, void *data)
 	if (ret)
 		goto end;
 	if (e->tp) {
-		ret = tracepoint_probe_unregister(e->tp, probe, data);
+		ret = lttng_tracepoint_probe_unregister_static(e->tp, probe, data);
 		WARN_ON_ONCE(ret);
 		ret = 0;
 	}
@@ -290,7 +307,7 @@ int lttng_tracepoint_going(struct tp_module *tp_mod)
 		list_for_each_entry(p, &e->probes, list) {
 			int ret;
 
-			ret = tracepoint_probe_unregister(e->tp,
+			ret = lttng_tracepoint_probe_unregister_static(e->tp,
 					p->tp_func.func, p->tp_func.data);
 			WARN_ON_ONCE(ret);
 		}
-- 
2.7.4



More information about the lttng-dev mailing list