From 9095efe93996c4ba9b758e8e2d706e8e2ae4b699 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 22 Oct 2011 20:17:37 -0400 Subject: [PATCH] Add get mmap base Signed-off-by: Mathieu Desnoyers --- include/ust/lttng-ust-ctl.h | 7 +++++-- libustctl/ustctl.c | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/ust/lttng-ust-ctl.h b/include/ust/lttng-ust-ctl.h index 52c954aa..ea3d0301 100644 --- a/include/ust/lttng-ust-ctl.h +++ b/include/ust/lttng-ust-ctl.h @@ -70,8 +70,6 @@ int ustctl_wait_quiescent(int sock); struct lttng_ust_calibrate; int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate); -/* TODO: object_data send/recv between sessiond and consumer */ - /* * Map channel shm_handle and add streams. Typically performed by the * consumer to map the objects into its memory space. @@ -90,6 +88,9 @@ void ustctl_unmap_channel(struct shm_handle *shm_handle); struct shm_handle; struct lib_ring_buffer; +void *ustctl_get_mmap_base(struct shm_handle *handle, + struct lib_ring_buffer *buf); + /* Open/close stream buffers for read */ struct lib_ring_buffer *ustctl_open_stream_read(struct shm_handle *handle, int cpu); @@ -108,6 +109,8 @@ int ustctl_get_max_subbuf_size(struct shm_handle *handle, * For mmap mode, operate on the current packet (between get/put or * get_next/put_next). */ +void *ustctl_get_mmap_base(struct shm_handle *handle, + struct lib_ring_buffer *buf); int ustctl_get_mmap_read_offset(struct shm_handle *handle, struct lib_ring_buffer *buf, unsigned long *off); int ustctl_get_subbuf_size(struct shm_handle *handle, diff --git a/libustctl/ustctl.c b/libustctl/ustctl.c index abe6d034..735e63cb 100644 --- a/libustctl/ustctl.c +++ b/libustctl/ustctl.c @@ -479,6 +479,12 @@ void ustctl_close_stream_read(struct shm_handle *handle, /* For mmap mode, readable without "get" operation */ +void *ustctl_get_mmap_base(struct shm_handle *handle, + struct lib_ring_buffer *buf) +{ + return shmp(handle, buf->backend.memory_map); +} + /* returns the length to mmap. */ int ustctl_get_mmap_len(struct shm_handle *handle, struct lib_ring_buffer *buf, -- 2.34.1