#include <usterr-signal-safe.h>
#include "tracepoint-internal.h"
#include "ltt-tracer-core.h"
+#include "../libringbuffer/tlsfixup.h"
/*
* Has lttng ust comm constructor been called ?
* the ust lock.
*/
lttng_fixup_event_tls();
+ lttng_fixup_ringbuffer_tls();
/*
* We want precise control over the order in which we construct
api.h \
backend.h backend_internal.h backend_types.h \
frontend_api.h frontend.h frontend_internal.h frontend_types.h \
- nohz.h vatomic.h
+ nohz.h vatomic.h tlsfixup.h
libringbuffer_la_LIBADD = \
-lpthread \
#include "backend.h"
#include "frontend.h"
#include "shm.h"
+#include "tlsfixup.h"
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
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));
+}
--- /dev/null
+#ifndef _LTTNG_UST_LIB_RINGBUFFER_TLS_FIXUP_H
+#define _LTTNG_UST_LIB_RINGBUFFER_TLS_FIXUP_H
+
+/*
+ * libringbuffer/tlsfixup.h
+ *
+ * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+void lttng_fixup_ringbuffer_tls(void);
+
+#endif /* _LTTNG_UST_LIB_RINGBUFFER_TLS_FIXUP_H */