From: Mathieu Desnoyers Date: Thu, 4 Aug 2011 22:36:12 +0000 (-0400) Subject: Add ring buffer comment about shm X-Git-Tag: v1.9.1~311 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2432c3c9bdce3c94632f7c619165ab1278a69551;p=lttng-ust.git Add ring buffer comment about shm Signed-off-by: Mathieu Desnoyers --- 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. */