Fix: populate possible num possible cpus cache with fd tracker lock
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 716795e0e818028d1a6fc6fa63374abaaf0ebafa..6f70f8f0a629b45682850c8343992964838ca3e7 100644 (file)
@@ -56,6 +56,7 @@
 #include "lttng-tracer-core.h"
 #include "compat.h"
 #include "../libringbuffer/rb-init.h"
+#include "../libringbuffer/smp.h"
 #include "lttng-ust-statedump.h"
 #include "clock.h"
 #include "../libringbuffer/getcpu.h"
@@ -1891,6 +1892,12 @@ void __attribute__((constructor)) lttng_ust_init(void)
        lttng_ust_clock_init();
        lttng_ust_getcpu_init();
        lttng_ust_statedump_init();
+       /*
+        * Populate possible cpus cache with the fd tracker lock held.
+        */
+       lttng_ust_lock_fd_tracker();
+       (void) num_possible_cpus();
+       lttng_ust_unlock_fd_tracker();
        lttng_ring_buffer_metadata_client_init();
        lttng_ring_buffer_client_overwrite_init();
        lttng_ring_buffer_client_overwrite_rt_init();
This page took 0.024245 seconds and 5 git commands to generate.