X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Flttng%2Ftracepoint.h;h=39f2c4db752342f14c5bd8206174093595ebacec;hb=b891574ec1aaaddf943361927da7a31ebb9db03d;hp=418857a8d6cd2cbaab98f9f65c391deac641dbff;hpb=9443a02239f525ddb4d17d91e840e9513e59a3d9;p=lttng-ust.git diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 418857a8..39f2c4db 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -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)); @@ -242,8 +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 @@ -310,8 +307,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; @@ -346,8 +347,6 @@ __tracepoints__destroy(void) } } -#endif - #ifdef TRACEPOINT_DEFINE /*