From 2c119d32e27cec677594279a58c3f6da1e3b3339 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 7cd41cbd7..8916daefa 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2255,6 +2255,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 7cd114b60..6b850d8c1 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -68,6 +68,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( @@ -225,6 +226,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