Fix: fixup vtid TLS
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 17:13:47 +0000 (12:13 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 17:41:16 +0000 (12:41 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Conflicts:

liblttng-ust/lttng-context-vtid.c

liblttng-ust/ltt-tracer-core.h
liblttng-ust/lttng-context-vtid.c
liblttng-ust/lttng-ust-comm.c

index 7fdf3c9efc52b892bda0140359d46083b0ccc0c1..2ea4eadfdd72a942182b350bffeda7b0bfe9fe76 100644 (file)
@@ -38,5 +38,6 @@ void ust_lock(void);
 void ust_unlock(void);
 
 void lttng_fixup_event_tls(void);
+void lttng_fixup_vtid_tls(void);
 
 #endif /* _LTT_TRACER_CORE_H */
index 6f7e078d22d2910072748adfd0ee59b8c9a695b4..22261f55e02173a6ffdf29370dfb879453c64f23 100644 (file)
@@ -12,6 +12,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
+#include "ltt-tracer-core.h"
 
 #ifdef __linux__
 #include <syscall.h>
@@ -92,3 +93,11 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
        field->record = vtid_record;
        return 0;
 }
+
+/*
+ * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ */
+void lttng_fixup_vtid_tls(void)
+{
+       asm volatile ("" : : "m" (cached_vtid));
+}
index b90df8610edb6cee07e0bef8ac4ec82cb787b5a2..e19fa949cbf69fd8cf70006898e8ddaa1796ca97 100644 (file)
@@ -840,6 +840,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
         */
        lttng_fixup_event_tls();
        lttng_fixup_ringbuffer_tls();
+       lttng_fixup_vtid_tls();
 
        /*
         * We want precise control over the order in which we construct
This page took 0.02713 seconds and 4 git commands to generate.