Multiple instances of the liblttng-ust-tracepoint were present in memory and
caused duplication and incoherence of various data structures (such as the
tracepoints hashtable). This is due to the dlopen(3) of liblttng-ust-tracepoint
in applications that were already linked against liblttng-ust-tracepoint.
This commit introduce a new restriction on application tracing:
the applications must be linked against liblttng-ust-tracepoint.
if (__tracepoint_registered++)
return;
if (__tracepoint_registered++)
return;
- tracepoint_dlopen.liblttngust_handle =
- dlopen("liblttng-ust-tracepoint.so.0", RTLD_NOW | RTLD_GLOBAL);
- if (!tracepoint_dlopen.liblttngust_handle)
- return;
tracepoint_dlopen.tracepoint_register_lib =
URCU_FORCE_CAST(int (*)(struct tracepoint * const *, int),
tracepoint_dlopen.tracepoint_register_lib =
URCU_FORCE_CAST(int (*)(struct tracepoint * const *, int),
- dlsym(tracepoint_dlopen.liblttngust_handle,
"tracepoint_register_lib"));
tracepoint_dlopen.tracepoint_unregister_lib =
URCU_FORCE_CAST(int (*)(struct tracepoint * const *),
"tracepoint_register_lib"));
tracepoint_dlopen.tracepoint_unregister_lib =
URCU_FORCE_CAST(int (*)(struct tracepoint * const *),
- dlsym(tracepoint_dlopen.liblttngust_handle,
"tracepoint_unregister_lib"));
#ifndef _LGPL_SOURCE
tracepoint_dlopen.rcu_read_lock_sym_bp =
URCU_FORCE_CAST(void (*)(void),
"tracepoint_unregister_lib"));
#ifndef _LGPL_SOURCE
tracepoint_dlopen.rcu_read_lock_sym_bp =
URCU_FORCE_CAST(void (*)(void),
- dlsym(tracepoint_dlopen.liblttngust_handle,
"tp_rcu_read_lock_bp"));
tracepoint_dlopen.rcu_read_unlock_sym_bp =
URCU_FORCE_CAST(void (*)(void),
"tp_rcu_read_lock_bp"));
tracepoint_dlopen.rcu_read_unlock_sym_bp =
URCU_FORCE_CAST(void (*)(void),
- dlsym(tracepoint_dlopen.liblttngust_handle,
"tp_rcu_read_unlock_bp"));
tracepoint_dlopen.rcu_dereference_sym_bp =
URCU_FORCE_CAST(void *(*)(void *p),
"tp_rcu_read_unlock_bp"));
tracepoint_dlopen.rcu_dereference_sym_bp =
URCU_FORCE_CAST(void *(*)(void *p),
- dlsym(tracepoint_dlopen.liblttngust_handle,
"tp_rcu_dereference_sym_bp"));
#endif
tracepoint_dlopen.tracepoint_register_lib(__start___tracepoints_ptrs,
"tp_rcu_dereference_sym_bp"));
#endif
tracepoint_dlopen.tracepoint_register_lib(__start___tracepoints_ptrs,