From 2432c3c9bdce3c94632f7c619165ab1278a69551 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 4 Aug 2011 18:36:12 -0400 Subject: [PATCH] Add ring buffer comment about shm Signed-off-by: Mathieu Desnoyers --- libringbuffer/ring_buffer_frontend.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 01d0f5e8..b45ec543 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -55,6 +55,22 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #endif +/* + * Use POSIX SHM: shm_open(3) and shm_unlink(3). + * close(2) to close the fd returned by shm_open. + * shm_unlink releases the shared memory object name. + * ftruncate(2) sets the size of the memory object. + * mmap/munmap maps the shared memory obj to a virtual address in the + * calling proceess (should be done both in libust and consumer). + * See shm_overview(7) for details. + * Pass file descriptor returned by shm_open(3) to ltt-sessiond through + * a UNIX socket. + * + * Since we don't need to access the object using its name, we can + * immediately shm_unlink(3) it, and only keep the handle with its file + * descriptor. + */ + /* * Internal structure representing offsets to use at a sub-buffer switch. */ -- 2.34.1