[lttng-dev] [PATCH lttng-ust] Fix: Expand the shmobj size for the sequence number

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Jun 22 15:38:33 UTC 2017


----- On Jun 22, 2017, at 4:56 AM, Liguang Li liguang.li at windriver.com wrote:

> This patch fixes a bug which was introduced by:
> 1ff31389b ("Generate and export the sequence number")

Merged into master, stable-2.10, stable-2.9, and stable-2.8,

Thanks!

Mathieu

> 
> Signed-off-by: Liguang Li <liguang.li at windriver.com>
> ---
> libringbuffer/ring_buffer_backend.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libringbuffer/ring_buffer_backend.c
> b/libringbuffer/ring_buffer_backend.c
> index 8eafc51..72c4910 100644
> --- a/libringbuffer/ring_buffer_backend.c
> +++ b/libringbuffer/ring_buffer_backend.c
> @@ -119,7 +119,7 @@ int lib_ring_buffer_backend_allocate(const struct
> lttng_ust_lib_ring_buffer_conf
> 		bufb->buf_rsb.id = subbuffer_id(config, 0, 1, 0);
> 
> 	/* Allocate subbuffer packet counter table */
> -	align_shm(shmobj, __alignof__(struct
> lttng_ust_lib_ring_buffer_backend_subbuffer));
> +	align_shm(shmobj, __alignof__(struct
> lttng_ust_lib_ring_buffer_backend_counts));
> 	set_shmp(bufb->buf_cnt, zalloc_shm(shmobj,
> 				sizeof(struct lttng_ust_lib_ring_buffer_backend_counts)
> 				* num_subbuf));
> @@ -334,6 +334,8 @@ int channel_backend_init(struct channel_backend *chanb,
> 	shmsize += sizeof(struct lttng_ust_lib_ring_buffer_backend_pages) *
> 	num_subbuf_alloc;
> 	shmsize += offset_align(shmsize, __alignof__(struct
> 	lttng_ust_lib_ring_buffer_backend_subbuffer));
> 	shmsize += sizeof(struct lttng_ust_lib_ring_buffer_backend_subbuffer) *
> 	num_subbuf;
> +	shmsize += offset_align(shmsize, __alignof__(struct
> lttng_ust_lib_ring_buffer_backend_counts));
> +	shmsize += sizeof(struct lttng_ust_lib_ring_buffer_backend_counts) *
> num_subbuf;
> 	/* Per-cpu buffer size: control (after backend) */
> 	shmsize += offset_align(shmsize, __alignof__(struct commit_counters_hot));
> 	shmsize += sizeof(struct commit_counters_hot) * num_subbuf;
> --
> 2.7.4
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list