Fix: perform TLS fixup of nest count outside of UST mutex
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 8c864f8ce595621434cfac4a08dec1aa705d5671..2c787f75b88ae3f32b27582bcaeb3607b52d4083 100644 (file)
@@ -136,6 +136,15 @@ extern void ltt_ring_buffer_client_overwrite_exit(void);
 extern void ltt_ring_buffer_client_discard_exit(void);
 extern void ltt_ring_buffer_metadata_client_exit(void);
 
+/*
+ * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ */
+static
+void lttng_fixup_nest_count_tls(void)
+{
+       asm volatile ("" : : "m" (lttng_ust_nest_count));
+}
+
 static
 int setup_local_apps(void)
 {
@@ -860,6 +869,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
        lttng_fixup_event_tls();
        lttng_fixup_ringbuffer_tls();
        lttng_fixup_vtid_tls();
+       lttng_fixup_nest_count_tls();
 
        /*
         * We want precise control over the order in which we construct
This page took 0.023205 seconds and 4 git commands to generate.