X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ust%2Flttng-context-net-ns.c;h=4f62c0551f1d23c622566b967451c7b3637cb366;hb=742ac92a271c97c49bd79444594c0e8dfe099f9e;hp=af80eab544302603d60426103888fa84e4b53992;hpb=b5457df5fd74e033cbaa75307f9bbc12aff4ab8f;p=lttng-ust.git diff --git a/src/lib/lttng-ust/lttng-context-net-ns.c b/src/lib/lttng-ust/lttng-context-net-ns.c index af80eab5..4f62c055 100644 --- a/src/lib/lttng-ust/lttng-context-net-ns.c +++ b/src/lib/lttng-ust/lttng-context-net-ns.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include "common/compat/tid.h" #include @@ -91,6 +91,7 @@ void lttng_context_net_ns_reset(void) static size_t net_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 net_ns_get_size(void *priv __attribute__((unused)), static void net_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 net_ns; @@ -113,9 +115,10 @@ void net_ns_record(void *priv __attribute__((unused)), static void net_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_net_ns(); + value->u.u64 = get_net_ns(); } static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( @@ -123,7 +126,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), net_ns_get_size, net_ns_record, @@ -148,9 +151,11 @@ error_find_context: } /* - * * Force a read (imply TLS fixup for dlopen) of TLS variables. - * */ -void lttng_fixup_net_ns_tls(void) + * Force a read (imply TLS allocation for dlopen) of TLS variables. + */ +void lttng_ust_net_ns_init_thread(int flags) { - asm volatile ("" : : "m" (URCU_TLS(cached_net_ns))); + __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_net_ns))); + if (flags & LTTNG_UST_INIT_THREAD_CONTEXT_CACHE) + (void)get_net_ns(); }