From f37bd90482562c086af4070caf1f218c832f5007 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 30 Mar 2021 12:07:51 -0400 Subject: [PATCH] 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 --- liblttng-ust/lttng-ring-buffer-client.h | 2 +- liblttng-ust/lttng-ring-buffer-metadata-client.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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; -- 2.34.1