From: Mathieu Desnoyers Date: Thu, 8 Dec 2011 21:37:03 +0000 (-0500) Subject: Add sock flush buffer ctl API X-Git-Tag: v1.9.1~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f1fffc5728684ddf7ec3c674515c313e693bd3c4;p=lttng-ust.git Add sock flush buffer ctl API Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 1ff34b9a..0f8aa835 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -59,6 +59,8 @@ int ustctl_tracepoint_list_get(int sock, int tp_list_handle, int ustctl_tracer_version(int sock, struct lttng_ust_tracer_version *v); int ustctl_wait_quiescent(int sock); +int ustctl_sock_flush_buffer(int sock, struct lttng_ust_object_data *object); + /* not implemented yet */ struct lttng_ust_calibrate; int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate); diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index b612d2ce..13100aeb 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -466,6 +466,22 @@ int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate) return -ENOSYS; } +int ustctl_sock_flush_buffer(int sock, struct lttng_ust_object_data *object) +{ + struct ustcomm_ust_msg lum; + struct ustcomm_ust_reply lur; + int ret; + + memset(&lum, 0, sizeof(lum)); + lum.handle = object->handle; + lum.cmd = LTTNG_UST_FLUSH_BUFFER; + ret = ustcomm_send_app_cmd(sock, &lum, &lur); + if (ret) + return ret; + DBG("flushed buffer handle %u", object->handle); + return 0; +} + /* Buffer operations */ /* Map channel shm into process memory */