X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-context-vsgid.c;h=f54288652f9cf520947a745a43157a85a415a305;hb=c35f268c4169db55bd65c95472442cd4d00eb53f;hp=eb051f27a2763baa684a44112219370230fe4ddd;hpb=8a57ec025ffbe56153748fd69b60118862707182;p=lttng-modules.git diff --git a/src/lttng-context-vsgid.c b/src/lttng-context-vsgid.c index eb051f27..f5428865 100644 --- a/src/lttng-context-vsgid.c +++ b/src/lttng-context-vsgid.c @@ -11,12 +11,13 @@ #include #include +#include + #include #include #include #include #include -#include static size_t vsgid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset) @@ -31,13 +32,12 @@ size_t vsgid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size static void vsgid_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, struct lttng_kernel_ring_buffer_ctx *ctx, - struct lttng_channel *chan) + struct lttng_kernel_channel_buffer *chan) { gid_t vsgid; - vsgid = lttng_current_vsgid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsgid)); - chan->ops->event_write(ctx, &vsgid, sizeof(vsgid)); + vsgid = from_kgid_munged(current_user_ns(), current_sgid()); + chan->ops->event_write(ctx, &vsgid, sizeof(vsgid), lttng_alignof(vsgid)); } static @@ -45,13 +45,13 @@ void vsgid_get_value(void *priv, struct lttng_kernel_probe_ctx *lttng_probe_ctx, struct lttng_ctx_value *value) { - value->u.s64 = lttng_current_vsgid(); + value->u.s64 = from_kgid_munged(current_user_ns(), current_sgid()); } static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field( lttng_kernel_static_event_field("vsgid", lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10), - false, false, false), + false, false), vsgid_get_size, vsgid_record, vsgid_get_value,