Fix: allow non-LGPL modules to use tracepoints
[lttng-ust.git] / include / lttng / tracepoint.h
index 95a045ed7df2b4a88309871632d341a20a26e733..3879920e30dd7cca6f98619da4dcdeccbfba4076 100644 (file)
@@ -218,16 +218,13 @@ struct lttng_ust_tracepoint_dlopen {
        int (*tracepoint_register_lib)(struct lttng_ust_tracepoint * const *tracepoints_start,
                int tracepoints_count);
        int (*tracepoint_unregister_lib)(struct lttng_ust_tracepoint * const *tracepoints_start);
-#ifndef _LGPL_SOURCE
        void (*rcu_read_lock_sym_bp)(void);
        void (*rcu_read_unlock_sym_bp)(void);
        void *(*rcu_dereference_sym_bp)(void *p);
-#endif
 };
 
 extern struct lttng_ust_tracepoint_dlopen tracepoint_dlopen;
-
-#if defined(TRACEPOINT_DEFINE) || defined(TRACEPOINT_CREATE_PROBES)
+extern struct lttng_ust_tracepoint_dlopen *tracepoint_dlopen_ptr;
 
 /*
  * These weak symbols, the constructor, and destructor take care of
@@ -295,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;
@@ -329,8 +330,6 @@ __tracepoints__destroy(void)
        }
 }
 
-#endif
-
 #ifdef TRACEPOINT_DEFINE
 
 /*
This page took 0.023148 seconds and 4 git commands to generate.