Fix: allow non-LGPL modules to use tracepoints
[lttng-ust.git] / include / lttng / tracepoint.h
index 17cbd41f93b1d11d972b867e7924eda2cca72c87..3879920e30dd7cca6f98619da4dcdeccbfba4076 100644 (file)
@@ -226,8 +226,6 @@ struct lttng_ust_tracepoint_dlopen {
 extern struct lttng_ust_tracepoint_dlopen tracepoint_dlopen;
 extern struct lttng_ust_tracepoint_dlopen *tracepoint_dlopen_ptr;
 
-#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
@@ -294,8 +292,12 @@ __tracepoints__init(void);
 static void
 __tracepoints__init(void)
 {
-       if (__tracepoint_registered++)
+       if (__tracepoint_registered++) {
+               if (!tracepoint_dlopen_ptr->liblttngust_handle)
+                       return;
+               __tracepoint__init_urcu_sym();
                return;
+       }
 
        if (!tracepoint_dlopen_ptr)
                tracepoint_dlopen_ptr = &tracepoint_dlopen;
@@ -328,8 +330,6 @@ __tracepoints__destroy(void)
        }
 }
 
-#endif
-
 #ifdef TRACEPOINT_DEFINE
 
 /*
This page took 0.024033 seconds and 4 git commands to generate.