From: Mathieu Desnoyers Date: Thu, 18 Apr 2013 16:08:53 +0000 (-0400) Subject: Safety-check: only call register_lib if found in liblttng-ust-tracepoint.so.0 X-Git-Tag: v2.1.3~12 X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=904d83549ae6fff57d2c4c6a00d36192abeb77e6 Safety-check: only call register_lib if found in liblttng-ust-tracepoint.so.0 If a liblttng-ust-tracepoint.so.0 would happen not to contain the expected symbols, don't trace (rather than segfault). Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 460ad205..ef41837c 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -303,9 +303,11 @@ __tracepoints__init(void) dlsym(tracepoint_dlopen.liblttngust_handle, "tp_rcu_dereference_sym_bp")); #endif - tracepoint_dlopen.tracepoint_register_lib(__start___tracepoints_ptrs, - __stop___tracepoints_ptrs - - __start___tracepoints_ptrs); + if (tracepoint_dlopen.tracepoint_register_lib) { + tracepoint_dlopen.tracepoint_register_lib(__start___tracepoints_ptrs, + __stop___tracepoints_ptrs - + __start___tracepoints_ptrs); + } } static void lttng_ust_notrace __attribute__((destructor))