X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libringbuffer%2Fring_buffer_frontend.c;h=8dfecf1d1fe98ffa98779de77198efc174405080;hb=b62f8205216d20d7ef16b536efd81389dc6fdd2f;hp=7b276ad935a3b89e4a10b1a41402f8976b80bd70;hpb=f0fde1c3984721c0660c7d5a1377db74b6c03a70;p=lttng-ust.git diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 7b276ad9..8dfecf1d 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include "smp.h" @@ -2125,7 +2125,7 @@ int lib_ring_buffer_try_reserve_slow(struct lttng_ust_lib_ring_buffer *buf, void *client_ctx) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; - struct lttng_ust_shm_handle *handle = ctx->handle; + struct lttng_ust_shm_handle *handle = ctx->chan->handle; unsigned long reserve_commit_diff, offset_cmp; int timeout_left_ms = lttng_ust_ringbuffer_get_timeout(chan); @@ -2152,7 +2152,7 @@ retry: &offsets->pre_header_padding, ctx, client_ctx); offsets->size += - lib_ring_buffer_align(offsets->begin + offsets->size, + lttng_ust_lib_ring_buffer_align(offsets->begin + offsets->size, ctx->largest_align) + ctx->data_size; if (caa_unlikely(subbuf_offset(offsets->begin, chan) + @@ -2258,7 +2258,7 @@ retry: &offsets->pre_header_padding, ctx, client_ctx); offsets->size += - lib_ring_buffer_align(offsets->begin + offsets->size, + lttng_ust_lib_ring_buffer_align(offsets->begin + offsets->size, ctx->largest_align) + ctx->data_size; if (caa_unlikely(subbuf_offset(offsets->begin, chan) @@ -2314,14 +2314,14 @@ int lib_ring_buffer_reserve_slow(struct lttng_ust_lib_ring_buffer_ctx *ctx, void *client_ctx) { struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan; - struct lttng_ust_shm_handle *handle = ctx->handle; + struct lttng_ust_shm_handle *handle = ctx->chan->handle; const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; struct lttng_ust_lib_ring_buffer *buf; struct switch_offsets offsets; int ret; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) - buf = shmp(handle, chan->backend.buf[ctx->cpu].shmp); + buf = shmp(handle, chan->backend.buf[ctx->reserve_cpu].shmp); else buf = shmp(handle, chan->backend.buf[0].shmp); if (!buf)