Move alignment into event write callback
[lttng-modules.git] / src / lttng-context-euid.c
index 3888da1dba3b4e2e63f575d3d6bbbb2bb4e589fc..7d344b1fea69799aa03fc6e23e92f24560203548 100644 (file)
@@ -19,7 +19,7 @@
 #include <wrapper/user_namespace.h>
 
 static
-size_t euid_get_size(size_t offset)
+size_t euid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset)
 {
        size_t size = 0;
 
@@ -29,23 +29,22 @@ size_t euid_get_size(size_t offset)
 }
 
 static
-void euid_record(struct lttng_kernel_ctx_field *field,
-                struct lib_ring_buffer_ctx *ctx,
-                struct lttng_channel *chan)
+void euid_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
+                struct lttng_kernel_ring_buffer_ctx *ctx,
+                struct lttng_kernel_channel_buffer *chan)
 {
        uid_t euid;
 
        euid = lttng_current_euid();
-       lib_ring_buffer_align_ctx(ctx, lttng_alignof(euid));
-       chan->ops->event_write(ctx, &euid, sizeof(euid));
+       chan->ops->event_write(ctx, &euid, sizeof(euid), lttng_alignof(euid));
 }
 
 static
-void euid_get_value(struct lttng_kernel_ctx_field *field,
-               struct lttng_probe_ctx *lttng_probe_ctx,
-               union lttng_ctx_value *value)
+void euid_get_value(void *priv,
+               struct lttng_kernel_probe_ctx *lttng_probe_ctx,
+               struct lttng_ctx_value *value)
 {
-       value->s64 = lttng_current_euid();
+       value->u.s64 = lttng_current_euid();
 }
 
 static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
@@ -53,7 +52,6 @@ static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_
                lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
                false, false, false),
        euid_get_size,
-       NULL,
        euid_record,
        euid_get_value,
        NULL, NULL);
This page took 0.024685 seconds and 4 git commands to generate.