Fix: application context header size
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 10 Mar 2016 00:37:56 +0000 (19:37 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 10 Mar 2016 00:40:02 +0000 (19:40 -0500)
We need to use the RCU-dereferenced pointer when calculating the context
header size, else it may race with application context
register/unregister.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ring-buffer-client.h

index 97e1f4406100cc9a954c638de4cff5f8558cca20..1ebb14e48ff05e218994dbc8710eb566b22f9fcd 100644 (file)
@@ -118,7 +118,7 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config,
                                 struct lttng_ust_lib_ring_buffer_ctx *ctx)
 {
        struct lttng_channel *lttng_chan = channel_get_private(chan);
-       struct lttng_event *event = ctx->priv;
+       struct lttng_stack_ctx *lttng_ctx = ctx->priv2;
        size_t orig_offset = offset;
        size_t padding;
 
@@ -157,8 +157,8 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config,
                padding = 0;
                WARN_ON_ONCE(1);
        }
-       offset += ctx_get_size(offset, lttng_chan->ctx);
-       offset += ctx_get_size(offset, event->ctx);
+       offset += ctx_get_size(offset, lttng_ctx->chan_ctx);
+       offset += ctx_get_size(offset, lttng_ctx->event_ctx);
 
        *pre_header_padding = padding;
        return offset - orig_offset;
This page took 0.025519 seconds and 4 git commands to generate.