Skip to contentSkip to conversation

Fix: allow non-LGPL modules to use tracepoints

RFC PATCH Sebastien Boisvert 1 participant 1 message Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

Sebastien Boisvert

author Tested-by
#1 lore raw
In reply to a message not in the archive

It links now.

Quoted 42 lines · Mathieu Desnoyers

Non-LGPL modules that use tracepoint instrumentation, but have no compile unit defining either TRACEPOINT_DEFINE or TRACEPOINT_CREATE_PROBES fail to build due to undefined reference to `tracepoint_dlopen_ptr'.

---
 include/lttng/tracepoint.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
include/lttng/tracepoint.h +5 -11
index 03bc913..d469765 100644
@@ -241,17 +241,6 @@ static inline void tracepoint_disable_destructors(void)
 	__tracepoints__disable_destructors = 1;
 }
 
-#if defined(TRACEPOINT_DEFINE) || defined(TRACEPOINT_CREATE_PROBES)
-
-/*
- * These weak symbols, the constructor, and destructor take care of
- * registering only _one_ instance of the tracepoints per shared-ojbect
- * (or for the whole main program).
- */
-int __tracepoint_registered
-	__attribute__((weak, visibility("hidden")));
-int __tracepoint_ptrs_registered
-	__attribute__((weak, visibility("hidden")));
 struct lttng_ust_tracepoint_dlopen tracepoint_dlopen
 	__attribute__((weak, visibility("hidden")));
 /*
@@ -304,6 +293,18 @@ __tracepoint__init_urcu_sym(void)
 }
 #endif
 
+#if defined(TRACEPOINT_DEFINE) || defined(TRACEPOINT_CREATE_PROBES)
+
+/*
+ * These weak symbols, the constructor, and destructor take care of
+ * registering only _one_ instance of the tracepoints per shared-ojbect

include/lttng/tracepoint.h __tracepoint__init_urcu_sym(void) · line 310

Quoted 10 lines
include/lttng/tracepoint.h +7 -0
+ * (or for the whole main program).
+ */
+int __tracepoint_registered
+	__attribute__((weak, visibility("hidden")));
+int __tracepoint_ptrs_registered
+	__attribute__((weak, visibility("hidden")));
+
 static void lttng_ust_notrace __attribute__((constructor))
 __tracepoints__init(void);
 static void

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev