lttng_ust_init_thread: initialise cached context values
[lttng-ust.git] / src / lib / lttng-ust / lttng-context-uts-ns.c
index 0ec8ed44adac564e2ee94c19d88ce2ac6c036d9c..51d6092e53158fb197269b25f8f79cf827df53cc 100644 (file)
@@ -92,6 +92,7 @@ void lttng_context_uts_ns_reset(void)
 
 static
 size_t uts_ns_get_size(void *priv __attribute__((unused)),
+               struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
                size_t offset)
 {
        size_t size = 0;
@@ -103,8 +104,9 @@ size_t uts_ns_get_size(void *priv __attribute__((unused)),
 
 static
 void uts_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 uts_ns;
 
@@ -114,9 +116,10 @@ void uts_ns_record(void *priv __attribute__((unused)),
 
 static
 void uts_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_uts_ns();
+       value->u.u64 = get_uts_ns();
 }
 
 static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field(
@@ -149,9 +152,11 @@ error_find_context:
 }
 
 /*
- *  * Force a read (imply TLS fixup for dlopen) of TLS variables.
- *   */
-void lttng_fixup_uts_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_ust_uts_ns_init_thread(int flags)
 {
        asm volatile ("" : : "m" (URCU_TLS(cached_uts_ns)));
+       if (flags & LTTNG_UST_INIT_THREAD_CONTEXT_CACHE)
+               (void)get_uts_ns();
 }
This page took 0.030278 seconds and 4 git commands to generate.