ustctl: Implement ring buffer clear
[lttng-ust.git] / liblttng-ust-ctl / ustctl.c
index 8c38ffaf05dfc169aa82be957ded5d1e4d9aee63..949ece17ace8a2d8ec2a2d624b0451fd5ee83313 100644 (file)
@@ -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,
This page took 0.022685 seconds and 4 git commands to generate.