lttng_ust_init_thread: initialise cached context values
[lttng-ust.git] / src / lib / lttng-ust / lttng-context-ipc-ns.c
index f37252cd81f36f40fd59da0d8d8f84dd6f7362da..078e646106b576bc8deee1778b0e291c6389f6e4 100644 (file)
@@ -17,7 +17,7 @@
 #include <lttng/ust-tracer.h>
 #include "common/compat/tid.h"
 #include <urcu/tls-compat.h>
-#include <lttng/ringbuffer-context.h>
+#include <lttng/ust-ringbuffer-context.h>
 
 #include "context-internal.h"
 #include "lttng-tracer-core.h"
@@ -91,6 +91,7 @@ void lttng_context_ipc_ns_reset(void)
 
 static
 size_t ipc_ns_get_size(void *priv __attribute__((unused)),
+               struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
                size_t offset)
 {
        size_t size = 0;
@@ -102,8 +103,9 @@ size_t ipc_ns_get_size(void *priv __attribute__((unused)),
 
 static
 void ipc_ns_record(void *priv __attribute__((unused)),
-                struct lttng_ust_ring_buffer_ctx *ctx,
-                struct lttng_ust_channel_buffer *chan)
+               struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
+               struct lttng_ust_ring_buffer_ctx *ctx,
+               struct lttng_ust_channel_buffer *chan)
 {
        ino_t ipc_ns;
 
@@ -113,17 +115,18 @@ void ipc_ns_record(void *priv __attribute__((unused)),
 
 static
 void ipc_ns_get_value(void *priv __attribute__((unused)),
+               struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
                struct lttng_ust_ctx_value *value)
 {
-       value->u.s64 = get_ipc_ns();
+       value->u.u64 = get_ipc_ns();
 }
 
-const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field(
+static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field(
        lttng_ust_static_event_field("ipc_ns",
                lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT,
                                lttng_ust_rb_alignof(ino_t) * CHAR_BIT,
                                lttng_ust_is_signed_type(ino_t),
-                               BYTE_ORDER, 10),
+                               LTTNG_UST_BYTE_ORDER, 10),
                false, false),
        ipc_ns_get_size,
        ipc_ns_record,
@@ -148,9 +151,11 @@ error_find_context:
 }
 
 /*
- *  * Force a read (imply TLS fixup for dlopen) of TLS variables.
- *   */
-void lttng_fixup_ipc_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_ust_ipc_ns_init_thread(int flags)
 {
        asm volatile ("" : : "m" (URCU_TLS(cached_ipc_ns)));
+       if (flags & LTTNG_UST_INIT_THREAD_CONTEXT_CACHE)
+               (void)get_ipc_ns();
 }
This page took 0.024329 seconds and 4 git commands to generate.