Refactor: lttng_ustctl_flush_buffer is a duplicate of lttng_ustconsumer_flush_buffer
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 5 Feb 2019 21:55:12 +0000 (16:55 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 18 Feb 2019 19:25:02 +0000 (14:25 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
src/common/consumer/consumer.c
src/common/ust-consumer/ust-consumer.c
src/common/ust-consumer/ust-consumer.h

index 10273e66a18fe496d98b1407a30a2ae9c840c1ea..3d725528a3a8638b54db5d0196a92936c6a44ba6 100644 (file)
@@ -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");
index 46f330052aa8c04fdd440b6f4dd30485634678c5..b5435c10d681d9240040117fa267c919441701d5 100644 (file)
@@ -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;
                }
 
index b0e1c7d0f847728b18f3f76ab8a3170a541302ab..7cd114b60c885b6c709e40341743a0cb55ccc4fa 100644 (file)
@@ -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)
 {
 }
This page took 0.044099 seconds and 5 git commands to generate.