X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust-ctl%2Fustctl.c;h=914ce94ea024c5ace40dccf405cbb5b80ed192be;hb=4e79769fe2af2d3e6ed2c14ef0058ed3a077fddc;hp=8c38ffaf05dfc169aa82be957ded5d1e4d9aee63;hpb=b2c5f61a9cb94a79c35167450666e540b3e0fffe;p=lttng-ust.git diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 8c38ffaf..914ce94e 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -17,14 +17,16 @@ */ #define _GNU_SOURCE +#include +#include #include +#include +#include + #include #include #include #include -#include -#include - #include #include #include @@ -77,8 +79,6 @@ extern void lttng_ring_buffer_client_discard_exit(void); extern void lttng_ring_buffer_client_discard_rt_exit(void); extern void lttng_ring_buffer_metadata_client_exit(void); -volatile enum ust_loglevel ust_loglevel; - int ustctl_release_handle(int sock, int handle) { struct ustcomm_ust_msg lum; @@ -1590,6 +1590,19 @@ void ustctl_flush_buffer(struct ustctl_consumer_stream *stream, consumer_chan->chan->handle); } +void ustctl_clear_buffer(struct ustctl_consumer_stream *stream) +{ + struct lttng_ust_lib_ring_buffer *buf; + struct ustctl_consumer_channel *consumer_chan; + + assert(stream); + buf = stream->buf; + consumer_chan = stream->chan; + lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, + consumer_chan->chan->handle); + lib_ring_buffer_clear_reader(buf, consumer_chan->chan->handle); +} + static struct lttng_ust_client_lib_ring_buffer_client_cb *get_client_cb( struct lttng_ust_lib_ring_buffer *buf,