X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ust%2Flttng-context-time-ns.c;h=e84b7048fae9cb37d0fc5b67eeaa7cfff081ea8f;hb=c246521ddcba1d1d28cfa0482aa500b9122e7264;hp=75e3e36506f1bf7608ec9818830779d3584c36b6;hpb=6339062a5bbe886493d0691d13e28e37a7206362;p=lttng-ust.git diff --git a/src/lib/lttng-ust/lttng-context-time-ns.c b/src/lib/lttng-ust/lttng-context-time-ns.c index 75e3e365..e84b7048 100644 --- a/src/lib/lttng-ust/lttng-context-time-ns.c +++ b/src/lib/lttng-ust/lttng-context-time-ns.c @@ -15,11 +15,11 @@ #include #include #include -#include +#include #include "common/compat/tid.h" #include #include "lttng-tracer-core.h" -#include "ns.h" +#include "common/ns.h" #include "context-internal.h" @@ -90,19 +90,21 @@ void lttng_context_time_ns_reset(void) static size_t time_ns_get_size(void *priv __attribute__((unused)), + struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)), size_t offset) { size_t size = 0; - size += lttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb_alignof(ino_t)); + size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(ino_t)); size += sizeof(ino_t); return size; } static void time_ns_record(void *priv __attribute__((unused)), - struct lttng_ust_lib_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 time_ns; @@ -112,9 +114,10 @@ void time_ns_record(void *priv __attribute__((unused)), static void time_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_time_ns(); + value->u.u64 = get_time_ns(); } static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( @@ -122,7 +125,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( 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), time_ns_get_size, time_ns_record, @@ -147,9 +150,11 @@ error_find_context: } /* - * * Force a read (imply TLS fixup for dlopen) of TLS variables. - * */ -void lttng_fixup_time_ns_tls(void) + * Force a read (imply TLS allocation for dlopen) of TLS variables. + */ +void lttng_ust_time_ns_init_thread(int flags) { asm volatile ("" : : "m" (URCU_TLS(cached_time_ns))); + if (flags & LTTNG_UST_INIT_THREAD_CONTEXT_CACHE) + (void)get_time_ns(); }