From b52190f262330b5ffbbdd49f1190114e68004069 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 5 Nov 2011 14:46:37 -0400 Subject: [PATCH] Allow flush buffer for inactive producer (flush mode) Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-ctl.h | 3 ++- liblttng-ust-ctl/ustctl.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 9d0d35c8..7fd66548 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -115,7 +115,8 @@ int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle, struct lttng_ust_lib_ring_buffer *buf); int ustctl_flush_buffer(struct lttng_ust_shm_handle *handle, - struct lttng_ust_lib_ring_buffer *buf); + struct lttng_ust_lib_ring_buffer *buf, + int producer_active); /* Release object created by members of this API */ void ustctl_release_object(int sock, struct lttng_ust_object_data *data); diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 886e8485..2d915260 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -650,8 +650,11 @@ int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle, } int ustctl_flush_buffer(struct lttng_ust_shm_handle *handle, - struct lttng_ust_lib_ring_buffer *buf) + struct lttng_ust_lib_ring_buffer *buf, + int producer_active) { - lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, handle); + lib_ring_buffer_switch_slow(buf, + producer_active ? SWITCH_ACTIVE : SWITCH_FLUSH, + handle); return 0; } -- 2.34.1