Move kprobes, uprobes, kretprobes, syscall structures to internal header
[lttng-modules.git] / src / lttng-ring-buffer-client.h
index ff404368edc6fac5ae6b48fddf0658f53a9bd842..cec656af5a7c20898c8b8db61226902dcf5edc0a 100644 (file)
@@ -13,6 +13,7 @@
 #include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/trace-clock.h>
 #include <lttng/events.h>
+#include <lttng/events-internal.h>
 #include <lttng/tracer.h>
 #include <ringbuffer/frontend_types.h>
 
@@ -98,11 +99,8 @@ void ctx_get_struct_size(struct lttng_kernel_ctx *ctx, size_t *ctx_len,
                return;
        }
        for (i = 0; i < ctx->nr_fields; i++) {
-               if (ctx->fields[i].get_size)
-                       offset += ctx->fields[i].get_size(offset);
-               if (ctx->fields[i].get_size_arg)
-                       offset += ctx->fields[i].get_size_arg(offset,
-                                       &ctx->fields[i], bufctx, chan);
+               offset += ctx->fields[i].get_size(ctx->fields[i].priv,
+                               bufctx->probe_ctx, offset);
        }
        *ctx_len = offset;
 }
@@ -118,7 +116,8 @@ void ctx_record(struct lib_ring_buffer_ctx *bufctx,
                return;
        lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
        for (i = 0; i < ctx->nr_fields; i++)
-               ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+               ctx->fields[i].record(ctx->fields[i].priv, bufctx->probe_ctx,
+                               bufctx, chan);
 }
 
 /*
@@ -604,17 +603,18 @@ void lttng_buffer_read_close(struct lib_ring_buffer *buf)
 }
 
 static
-int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
-                     uint32_t event_id)
+int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx)
 {
        struct lttng_kernel_event_recorder *event_recorder = ctx->client_priv;
        struct lttng_channel *lttng_chan = event_recorder->chan;
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
+       uint32_t event_id;
 
        cpu = lib_ring_buffer_get_cpu(&client_config);
        if (unlikely(cpu < 0))
                return -EPERM;
+       event_id = event_recorder->priv->id;
        memset(&ctx->priv, 0, sizeof(ctx->priv));
        ctx->priv.chan = lttng_chan->chan;
        ctx->priv.reserve_cpu = cpu;
This page took 0.023851 seconds and 4 git commands to generate.