All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-ust] Fix: allocate ts_end in ringbuffer shared memory
@ 2019-05-10 15:12 Gabriel-Andrew Pollo-Guilbert
  0 siblings, 0 replies; only message in thread
From: Gabriel-Andrew Pollo-Guilbert @ 2019-05-10 15:12 UTC (permalink / raw)
  To: lttng-dev

This patch allocates the memory used by the ts_end field added by commit
6c737d05. When allocating lots of subbuffer for a channel (512 or more),
zalloc_shm() will fail to allocate all the objects because the allocated memory
map didn't take account the newly added field.

Signed-off-by: Gabriel-Andrew Pollo-Guilbert <gabriel.pollo-guilbert@efficios.com>
---
 libringbuffer/ring_buffer_backend.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c
index a0ef7446..431b8eae 100644
--- a/libringbuffer/ring_buffer_backend.c
+++ b/libringbuffer/ring_buffer_backend.c
@@ -341,6 +341,9 @@ int channel_backend_init(struct channel_backend *chanb,
 	shmsize += sizeof(struct commit_counters_hot) * num_subbuf;
 	shmsize += offset_align(shmsize, __alignof__(struct commit_counters_cold));
 	shmsize += sizeof(struct commit_counters_cold) * num_subbuf;
+	/* Sampled timestamp end */
+	shmsize += offset_align(shmsize, __alignof__(uint64_t));
+	shmsize += sizeof(uint64_t) * num_subbuf;
 
 	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
 		struct lttng_ust_lib_ring_buffer *buf;
-- 
2.21.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-10 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 15:12 [PATCH lttng-ust] Fix: allocate ts_end in ringbuffer shared memory Gabriel-Andrew Pollo-Guilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.