From 904d83549ae6fff57d2c4c6a00d36192abeb77e6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 18 Apr 2013 12:08:53 -0400 Subject: [PATCH] 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 --- include/lttng/tracepoint.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) -- 2.34.1