Assign CPU id before saving the context size
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 30 May 2017 15:53:35 +0000 (11:53 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Jun 2018 18:38:58 +0000 (14:38 -0400)
The callstack contexts will use the CPU id to save per-CPU data so this
field needs to be set before calling the get_size function of this
context.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-ring-buffer-client.h

index 8b87db0d4ca47e3d7e0b696db0002efb30b59a34..7cf3a4c81861987f88bc4057bd3c1049d6f05897 100644 (file)
@@ -636,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, lttng_chan, ctx);
-       ctx_get_struct_size(event->ctx, &client_ctx.event_context_len, lttng_chan, ctx);
-
        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)
This page took 0.027231 seconds and 4 git commands to generate.