From e0d2fee2689b1d52c4293300418147ce6f9a92bb Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 5 Feb 2019 16:55:12 -0500 Subject: [PATCH] Refactor: lttng_ustctl_flush_buffer is a duplicate of lttng_ustconsumer_flush_buffer Signed-off-by: Jonathan Rajotte --- src/common/consumer/consumer.c | 2 +- src/common/ust-consumer/ust-consumer.c | 19 +++++-------------- src/common/ust-consumer/ust-consumer.h | 7 ------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 10273e66a..3d725528a 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -3883,7 +3883,7 @@ int consumer_flush_buffer(struct lttng_consumer_stream *stream, int producer_act break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: - lttng_ustctl_flush_buffer(stream, producer_active); + lttng_ustconsumer_flush_buffer(stream, producer_active); break; default: ERR("Unknown consumer_data type"); diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 46f330052..b5435c10d 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -765,7 +765,7 @@ static int flush_channel(uint64_t chan_key) pthread_mutex_lock(&stream->lock); if (!stream->quiescent) { - ustctl_flush_buffer(stream->ustream, 0); + lttng_ustconsumer_flush_buffer(stream, 0); stream->quiescent = true; } pthread_mutex_unlock(&stream->lock); @@ -1137,7 +1137,7 @@ static int snapshot_channel(struct lttng_consumer_channel *channel, * Else, if quiescent, it has already been done by the prior stop. */ if (!stream->quiescent) { - ustctl_flush_buffer(stream->ustream, 0); + lttng_ustconsumer_flush_buffer(stream, 0); } ret = lttng_ustconsumer_take_snapshot(stream); @@ -2189,15 +2189,6 @@ void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream) return ustctl_get_mmap_base(stream->ustream); } -void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream, - int producer_active) -{ - assert(stream); - assert(stream->ustream); - - ustctl_flush_buffer(stream->ustream, producer_active); -} - /* * Take a snapshot for a specific stream. * @@ -2294,7 +2285,7 @@ void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream) pthread_mutex_lock(&stream->lock); if (!stream->quiescent) { - ustctl_flush_buffer(stream->ustream, 0); + lttng_ustconsumer_flush_buffer(stream, 0); stream->quiescent = true; } pthread_mutex_unlock(&stream->lock); @@ -2560,7 +2551,7 @@ int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx, retry = 1; } - ustctl_flush_buffer(metadata->ustream, 1); + lttng_ustconsumer_flush_buffer(metadata, 1); ret = ustctl_snapshot(metadata->ustream); if (ret < 0) { if (errno != EAGAIN) { @@ -2764,7 +2755,7 @@ retry: if (ret <= 0) { goto error; } - ustctl_flush_buffer(stream->ustream, 1); + lttng_ustconsumer_flush_buffer(stream, 1); goto retry; } diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index b0e1c7d0f..7cd114b60 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -53,8 +53,6 @@ void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream); int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream, unsigned long *off); void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream); -void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream, - int producer_active); int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, uint64_t *stream_id); int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream); @@ -191,11 +189,6 @@ void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream) return NULL; } static inline -void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream, - int producer_active) -{ -} -static inline void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht) { } -- 2.34.1