Fix: malloc libc instrumentation wrapper
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 0c96f012f528fd4929581107e45ba9314430a92e..27786945b46430e99f5a173ee28a9c7907c6a03c 100644 (file)
@@ -1310,6 +1310,14 @@ quit:
        return NULL;
 }
 
+/*
+ * Weak symbol to call when the ust malloc wrapper is not loaded.
+ */
+__attribute__((weak))
+void lttng_ust_malloc_wrapper_init(void)
+{
+}
+
 /*
  * sessiond monitoring thread: monitor presence of global and per-user
  * sessiond by polling the application common named pipe.
@@ -1350,6 +1358,10 @@ void __attribute__((constructor)) lttng_ust_init(void)
        lttng_ring_buffer_client_discard_init();
        lttng_ring_buffer_client_discard_rt_init();
        lttng_context_init();
+       /*
+        * Invoke ust malloc wrapper init before starting other threads.
+        */
+       lttng_ust_malloc_wrapper_init();
 
        timeout_mode = get_constructor_timeout(&constructor_timeout);
 
This page took 0.023083 seconds and 4 git commands to generate.