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:13:47 +0000 (12:13 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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 3fe86405c112307a47e6c1abe0a9c62fe8b2175b..c419d18b3ede7db666d2c5ea3cada82df6dafcbd 100644 (file)
@@ -13,6 +13,7 @@
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
 #include <lttng/ust-tid.h>
+#include "ltt-tracer-core.h"
 
 /*
  * We cache the result to ensure we don't trigger a system call for
@@ -74,3 +75,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 2f2c783b189966d19181ae98bec17a020152c002..1815801a8fe08a06df22b6d1614efc969ca75b4d 100644 (file)
@@ -835,6 +835,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.028329 seconds and 4 git commands to generate.