Fix: tls-compat with hidden ring buffer context
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Mar 2021 16:07:51 +0000 (12:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Mar 2021 16:07:51 +0000 (12:07 -0400)
There are additional missing URCU_TLS() accessors in the refactoring of
the ring buffer context. Moreover, when indexing an array, it must be
done outside of the URCU_TLS() accessor.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ief9d31e26e16fa5decf797b23ed6304b5a8c79ca

liblttng-ust/lttng-ring-buffer-client.h
liblttng-ust/lttng-ring-buffer-metadata-client.h

index fb7ba25521fce4eddb5519629218b738b651fd3a..dc3dd88f4260b7b2545e254de8c180efcb328e5c 100644 (file)
@@ -732,7 +732,7 @@ int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx *ctx)
        if (nesting < 0)
                return -EPERM;
 
-       private_ctx = &URCU_TLS(private_ctx_stack[nesting]);
+       private_ctx = &URCU_TLS(private_ctx_stack)[nesting];
        memset(private_ctx, 0, sizeof(*private_ctx));
        private_ctx->pub = ctx;
        private_ctx->chan = lttng_chan->priv->rb_chan;
index 8a0fdc5c9dbfbccb34ddcd9c6d37bbaee5eed81c..f4d1362a6e9b95303349483a574842815a96ed77 100644 (file)
@@ -248,10 +248,10 @@ int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx *ctx)
 {
        int ret;
 
-       memset(&private_ctx, 0, sizeof(private_ctx));
-       private_ctx.pub = ctx;
-       private_ctx.chan = ctx->client_priv;
-       ctx->priv = &private_ctx;
+       memset(&URCU_TLS(private_ctx), 0, sizeof(struct lttng_ust_lib_ring_buffer_ctx_private));
+       URCU_TLS(private_ctx).pub = ctx;
+       URCU_TLS(private_ctx).chan = ctx->client_priv;
+       ctx->priv = &URCU_TLS(private_ctx);
        ret = lib_ring_buffer_reserve(&client_config, ctx, NULL);
        if (ret)
                return ret;
This page took 0.027286 seconds and 4 git commands to generate.