Fix: fixup ringbuffer tls at constructor by forcing read
[lttng-ust.git] / libringbuffer / ring_buffer_frontend.c
index 0996ecefc0313ff5ef8b955ce7dffd3a6a793849..970fde90a2a79bd0d8638f2eefc168b07c7e8499 100644 (file)
@@ -53,6 +53,7 @@
 #include "backend.h"
 #include "frontend.h"
 #include "shm.h"
+#include "tlsfixup.h"
 
 #ifndef max
 #define max(a, b)      ((a) > (b) ? (a) : (b))
@@ -1507,3 +1508,11 @@ int lib_ring_buffer_reserve_slow(struct lttng_ust_lib_ring_buffer_ctx *ctx)
        ctx->buf_offset = offsets.begin + offsets.pre_header_padding;
        return 0;
 }
+
+/*
+ * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ */
+void lttng_fixup_ringbuffer_tls(void)
+{
+       asm volatile ("" : : "m" (lib_ring_buffer_nesting));
+}
This page took 0.023819 seconds and 4 git commands to generate.