Safety-check: only call register_lib if found in liblttng-ust-tracepoint.so.0
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Apr 2013 16:08:53 +0000 (12:08 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Apr 2013 16:25:55 +0000 (12:25 -0400)
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 <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h

index 460ad205a481d196d1702f32c44392833cb0724a..ef41837c6b6b0d9a716ba70ee07c40d10a7cab41 100644 (file)
@@ -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))
This page took 0.025653 seconds and 4 git commands to generate.