From: Mathieu Desnoyers Date: Sat, 5 Nov 2011 18:46:37 +0000 (-0400) Subject: Allow flush buffer for inactive producer (flush mode) X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=b52190f262330b5ffbbdd49f1190114e68004069;p=lttng-ust.git Allow flush buffer for inactive producer (flush mode) Signed-off-by: Mathieu Desnoyers --- 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; }