X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-context-user-ns.c;h=f7ee3f913234c9ecc7de246488e5b385e4317182;hb=92e7fc0251da026f756f648fea5639cfdd746fff;hp=4ca4df2fa47080add28efb838446101bf2d6e3e5;hpb=a92e844e9e4cc9d5c4a7ec3d1c0738d375430446;p=lttng-modules.git diff --git a/src/lttng-context-user-ns.c b/src/lttng-context-user-ns.c index 4ca4df2f..f7ee3f91 100644 --- a/src/lttng-context-user-ns.c +++ b/src/lttng-context-user-ns.c @@ -9,6 +9,8 @@ * */ +#ifdef CONFIG_USER_NS + #include #include #include @@ -17,12 +19,8 @@ #include #include #include -#include #include -#if defined(CONFIG_USER_NS) && \ - (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) - static size_t user_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset) { @@ -35,16 +33,15 @@ size_t user_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, si static void user_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, - struct lib_ring_buffer_ctx *ctx, - struct lttng_channel *chan) + struct lttng_kernel_ring_buffer_ctx *ctx, + struct lttng_kernel_channel_buffer *chan) { unsigned int user_ns_inum = 0; if (current_user_ns()) - user_ns_inum = current_user_ns()->lttng_ns_inum; + user_ns_inum = current_user_ns()->ns.inum; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(user_ns_inum)); - chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum)); + chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum), lttng_alignof(user_ns_inum)); } static @@ -55,7 +52,7 @@ void user_ns_get_value(void *priv, unsigned int user_ns_inum = 0; if (current_user_ns()) - user_ns_inum = current_user_ns()->lttng_ns_inum; + user_ns_inum = current_user_ns()->ns.inum; value->u.s64 = user_ns_inum; } @@ -63,7 +60,7 @@ void user_ns_get_value(void *priv, static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field( lttng_kernel_static_event_field("user_ns", lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10), - false, false, false), + false, false), user_ns_get_size, user_ns_record, user_ns_get_value,