Fix: initialize RCU callbacks with mixed LGPL/non-LGPL objects
[lttng-ust.git] / include / lttng / tracepoint.h
index 418857a8d6cd2cbaab98f9f65c391deac641dbff..03bc913fd877292857215165d2926bc003cc11dd 100644 (file)
@@ -218,14 +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;
+extern struct lttng_ust_tracepoint_dlopen *tracepoint_dlopen_ptr;
 
 /* Disable tracepoint destructors. */
 int __tracepoints__disable_destructors __attribute__((weak));
@@ -310,8 +309,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;
This page took 0.024679 seconds and 4 git commands to generate.