+#ifndef _LGPL_SOURCE
+static inline void lttng_ust_notrace
+__tracepoint__init_urcu_sym(void);
+static inline void
+__tracepoint__init_urcu_sym(void)
+{
+ if (!tracepoint_dlopen_ptr)
+ tracepoint_dlopen_ptr = &tracepoint_dlopen;
+ /*
+ * Symbols below are needed by tracepoint call sites and probe
+ * providers.
+ */
+ if (!tracepoint_dlopen_ptr->rcu_read_lock_sym_bp)
+ tracepoint_dlopen_ptr->rcu_read_lock_sym_bp =
+ URCU_FORCE_CAST(void (*)(void),
+ dlsym(tracepoint_dlopen_ptr->liblttngust_handle,
+ "tp_rcu_read_lock_bp"));
+ if (!tracepoint_dlopen_ptr->rcu_read_unlock_sym_bp)
+ tracepoint_dlopen_ptr->rcu_read_unlock_sym_bp =
+ URCU_FORCE_CAST(void (*)(void),
+ dlsym(tracepoint_dlopen_ptr->liblttngust_handle,
+ "tp_rcu_read_unlock_bp"));
+ if (!tracepoint_dlopen_ptr->rcu_dereference_sym_bp)
+ tracepoint_dlopen_ptr->rcu_dereference_sym_bp =
+ URCU_FORCE_CAST(void *(*)(void *p),
+ dlsym(tracepoint_dlopen_ptr->liblttngust_handle,
+ "tp_rcu_dereference_sym_bp"));
+}
+#else
+static inline void lttng_ust_notrace
+__tracepoint__init_urcu_sym(void);
+static inline void
+__tracepoint__init_urcu_sym(void)
+{
+}
+#endif
+
+static void lttng_ust_notrace __attribute__((constructor))
+__tracepoints__init(void);
+static void
+__tracepoints__init(void)
+{
+ if (__tracepoint_registered++) {
+ if (!tracepoint_dlopen_ptr->liblttngust_handle)
+ return;
+ __tracepoint__init_urcu_sym();
+ return;
+ }
+
+ if (!tracepoint_dlopen_ptr)
+ tracepoint_dlopen_ptr = &tracepoint_dlopen;
+ if (!tracepoint_dlopen_ptr->liblttngust_handle)
+ tracepoint_dlopen_ptr->liblttngust_handle =
+ dlopen("liblttng-ust-tracepoint.so.0", RTLD_NOW | RTLD_GLOBAL);
+ if (!tracepoint_dlopen_ptr->liblttngust_handle)
+ return;
+ __tracepoint__init_urcu_sym();
+}
+
+static void lttng_ust_notrace __attribute__((destructor))
+__tracepoints__destroy(void);
+static void
+__tracepoints__destroy(void)