From 087b053bd0306f442a45c5e88f3fc2148f08b62a Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 12 Feb 2019 10:57:41 -0500 Subject: [PATCH] Ust consumer: Expose userspace clear buffer operation Signed-off-by: Jonathan Rajotte --- src/common/ust-consumer/ust-consumer.c | 8 ++++++++ src/common/ust-consumer/ust-consumer.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 3d3a30dcd..9de9aca5d 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2069,6 +2069,14 @@ void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, ustctl_flush_buffer(stream->ustream, producer); } +void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream) +{ + assert(stream); + assert(stream->ustream); + + ustctl_clear_buffer(stream->ustream); +} + int lttng_ustconsumer_get_current_timestamp( struct lttng_consumer_stream *stream, uint64_t *ts) { diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index b5ff16186..02639b9a5 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -67,6 +67,7 @@ int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx, struct lttng_consumer_stream *metadata); void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, int producer); +void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream); int lttng_ustconsumer_get_current_timestamp( struct lttng_consumer_stream *stream, uint64_t *ts); int lttng_ustconsumer_get_sequence_number( @@ -224,6 +225,10 @@ void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, { } static inline +void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream) +{ +} +static inline int lttng_ustconsumer_get_current_timestamp( struct lttng_consumer_stream *stream, uint64_t *ts) { -- 2.34.1