Cleanup: modinfo keys
[lttng-modules.git] / lttng-ring-buffer-client.h
index 48d304293b95c4f7baa84ee44784810928f1ce77..4700ae53f658d9087c498df5a27d8933fa5903b6 100644 (file)
@@ -100,7 +100,8 @@ size_t ctx_get_aligned_size(size_t offset, struct lttng_ctx *ctx,
 }
 
 static inline
-void ctx_get_struct_size(struct lttng_ctx *ctx, size_t *ctx_len)
+void ctx_get_struct_size(struct lttng_ctx *ctx, size_t *ctx_len,
+               struct lttng_channel *chan, struct lib_ring_buffer_ctx *bufctx)
 {
        int i;
        size_t offset = 0;
@@ -109,8 +110,13 @@ void ctx_get_struct_size(struct lttng_ctx *ctx, size_t *ctx_len)
                *ctx_len = 0;
                return;
        }
-       for (i = 0; i < ctx->nr_fields; i++)
-               offset += ctx->fields[i].get_size(offset);
+       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);
+       }
        *ctx_len = offset;
 }
 
@@ -630,15 +636,15 @@ int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
 
-       /* Compute internal size of context structures. */
-       ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len);
-       ctx_get_struct_size(event->ctx, &client_ctx.event_context_len);
-
        cpu = lib_ring_buffer_get_cpu(&client_config);
        if (unlikely(cpu < 0))
                return -EPERM;
        ctx->cpu = cpu;
 
+       /* Compute internal size of context structures. */
+       ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len, lttng_chan, ctx);
+       ctx_get_struct_size(event->ctx, &client_ctx.event_context_len, lttng_chan, ctx);
+
        switch (lttng_chan->header_type) {
        case 1: /* compact */
                if (event_id > 30)
@@ -788,6 +794,10 @@ static void __exit lttng_ring_buffer_client_exit(void)
 module_exit(lttng_ring_buffer_client_exit);
 
 MODULE_LICENSE("GPL and additional rights");
-MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
 MODULE_DESCRIPTION("LTTng ring buffer " RING_BUFFER_MODE_TEMPLATE_STRING
                   " client");
+MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "."
+       __stringify(LTTNG_MODULES_MINOR_VERSION) "."
+       __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)
+       LTTNG_MODULES_EXTRAVERSION);
This page took 0.023499 seconds and 4 git commands to generate.