From: Mathieu Desnoyers Date: Tue, 30 Mar 2021 16:07:51 +0000 (-0400) Subject: Fix: tls-compat with hidden ring buffer context X-Git-Tag: v2.13.0-rc1~175 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f37bd90482562c086af4070caf1f218c832f5007;p=lttng-ust.git Fix: tls-compat with hidden ring buffer context 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 Change-Id: Ief9d31e26e16fa5decf797b23ed6304b5a8c79ca --- diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h index fb7ba255..dc3dd88f 100644 --- a/liblttng-ust/lttng-ring-buffer-client.h +++ b/liblttng-ust/lttng-ring-buffer-client.h @@ -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; diff --git a/liblttng-ust/lttng-ring-buffer-metadata-client.h b/liblttng-ust/lttng-ring-buffer-metadata-client.h index 8a0fdc5c..f4d1362a 100644 --- a/liblttng-ust/lttng-ring-buffer-metadata-client.h +++ b/liblttng-ust/lttng-ring-buffer-metadata-client.h @@ -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;