consumer: Rename net_seq_idx to relayd_id
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Jul 2018 19:26:37 +0000 (15:26 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 25 Jun 2019 15:08:08 +0000 (11:08 -0400)
The consumer's streams refer to a 'net_seq_idx' of which the
meaning must have been lost in the sands of time. It is a
unique identifier of a given relay daemon. Hence, renaming it to
'relayd_id' appears sensible.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
src/common/consumer/consumer-stream.c
src/common/consumer/consumer.c
src/common/consumer/consumer.h
src/common/kernel-consumer/kernel-consumer.c
src/common/ust-consumer/ust-consumer.c

index f5ca6b71ea3de705bacee2a78fa15db5b260c6f6..b2a5d41fd94a0d7fc9fd5660f6c8aaceb2ad5a33 100644 (file)
@@ -72,7 +72,7 @@ void consumer_stream_relayd_close(struct lttng_consumer_stream *stream,
                        stream->relayd_stream_id,
                        stream->next_net_seq_num - 1);
        if (ret < 0) {
-               ERR("Relayd send close stream failed. Cleaning up relayd %" PRIu64 ".", relayd->net_seq_idx);
+               ERR("Relayd send close stream failed. Cleaning up relayd %" PRIu64 ".", relayd->id);
                lttng_consumer_cleanup_relayd(relayd);
        }
        pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
@@ -82,7 +82,7 @@ void consumer_stream_relayd_close(struct lttng_consumer_stream *stream,
                        uatomic_read(&relayd->destroy_flag)) {
                consumer_destroy_relayd(relayd);
        }
-       stream->net_seq_idx = (uint64_t) -1ULL;
+       stream->relayd_id = (uint64_t) -1ULL;
        stream->sent_to_relayd = 0;
 }
 
@@ -166,7 +166,7 @@ void consumer_stream_close(struct lttng_consumer_stream *stream)
 
        /* Check and cleanup relayd if needed. */
        rcu_read_lock();
-       relayd = consumer_find_relayd(stream->net_seq_idx);
+       relayd = consumer_find_relayd(stream->relayd_id);
        if (relayd != NULL) {
                consumer_stream_relayd_close(stream, relayd);
        }
@@ -360,9 +360,9 @@ int consumer_stream_write_index(struct lttng_consumer_stream *stream,
        assert(element);
 
        rcu_read_lock();
-       if (stream->net_seq_idx != (uint64_t) -1ULL) {
+       if (stream->relayd_id != (uint64_t) -1ULL) {
                struct consumer_relayd_sock_pair *relayd;
-               relayd = consumer_find_relayd(stream->net_seq_idx);
+               relayd = consumer_find_relayd(stream->relayd_id);
                if (relayd) {
                        pthread_mutex_lock(&relayd->ctrl_sock_mutex);
                        ret = relayd_send_index(&relayd->control_sock, element,
@@ -372,14 +372,14 @@ int consumer_stream_write_index(struct lttng_consumer_stream *stream,
                                 * Communication error with lttng-relayd,
                                 * perform cleanup now
                                 */
-                               ERR("Relayd send index failed. Cleaning up relayd %" PRIu64 ".", relayd->net_seq_idx);
+                               ERR("Relayd send index failed. Cleaning up relayd %" PRIu64 ".", relayd->id);
                                lttng_consumer_cleanup_relayd(relayd);
                                ret = -1;
                        }
                        pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                } else {
                        ERR("Stream %" PRIu64 " relayd ID %" PRIu64 " unknown. Can't write index.",
-                                       stream->key, stream->net_seq_idx);
+                                       stream->key, stream->relayd_id);
                        ret = -1;
                }
        } else {
index b99a3f5818ce40b3b57a09cc84c89b2c7a6e0dd4..b03bd39a96b97f747a4ace81aa087f01f3c774d1 100644 (file)
@@ -417,25 +417,24 @@ static void cleanup_relayd_ht(void)
 }
 
 /*
- * Update the end point status of all streams having the given network sequence
- * index (relayd index).
+ * Update the end point status of all streams having the given relayd id.
  *
  * It's atomically set without having the stream mutex locked which is fine
  * because we handle the write/read race with a pipe wakeup for each thread.
  */
-static void update_endpoint_status_by_netidx(uint64_t net_seq_idx,
+static void update_endpoint_status_by_netidx(uint64_t relayd_id,
                enum consumer_endpoint_status status)
 {
        struct lttng_ht_iter iter;
        struct lttng_consumer_stream *stream;
 
-       DBG("Consumer set delete flag on stream by idx %" PRIu64, net_seq_idx);
+       DBG("Consumer set delete flag on stream by idx %" PRIu64, relayd_id);
 
        rcu_read_lock();
 
        /* Let's begin with metadata */
        cds_lfht_for_each_entry(metadata_ht->ht, &iter.iter, stream, node.node) {
-               if (stream->net_seq_idx == net_seq_idx) {
+               if (stream->relayd_id == relayd_id) {
                        uatomic_set(&stream->endpoint_status, status);
                        DBG("Delete flag set to metadata stream %d", stream->wait_fd);
                }
@@ -443,7 +442,7 @@ static void update_endpoint_status_by_netidx(uint64_t net_seq_idx,
 
        /* Follow up by the data streams */
        cds_lfht_for_each_entry(data_ht->ht, &iter.iter, stream, node.node) {
-               if (stream->net_seq_idx == net_seq_idx) {
+               if (stream->relayd_id == relayd_id) {
                        uatomic_set(&stream->endpoint_status, status);
                        DBG("Delete flag set to data stream %d", stream->wait_fd);
                }
@@ -465,10 +464,10 @@ void lttng_consumer_cleanup_relayd(struct consumer_relayd_sock_pair *relayd)
 
        assert(relayd);
 
-       DBG("Cleaning up relayd object ID %"PRIu64, relayd->net_seq_idx);
+       DBG("Cleaning up relayd object ID %"PRIu64, relayd->id);
 
        /* Save the net sequence index before destroying the object */
-       netidx = relayd->net_seq_idx;
+       netidx = relayd->id;
 
        /*
         * Delete the relayd from the relayd hash table, close the sockets and free
@@ -565,7 +564,7 @@ struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
        stream->state = state;
        stream->uid = uid;
        stream->gid = gid;
-       stream->net_seq_idx = relayd_id;
+       stream->relayd_id = relayd_id;
        stream->session_id = session_id;
        stream->monitor = monitor;
        stream->endpoint_status = CONSUMER_ENDPOINT_ACTIVE;
@@ -604,7 +603,7 @@ struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
        DBG3("Allocated stream %s (key %" PRIu64 ", chan_key %" PRIu64
                        " relayd_id %" PRIu64 ", session_id %" PRIu64,
                        stream->name, stream->key, channel_key,
-                       stream->net_seq_idx, stream->session_id);
+                       stream->relayd_id, stream->session_id);
 
        rcu_read_unlock();
        return stream;
@@ -697,7 +696,7 @@ static int add_relayd(struct consumer_relayd_sock_pair *relayd)
        assert(relayd);
 
        lttng_ht_lookup(consumer_data.relayd_ht,
-                       &relayd->net_seq_idx, &iter);
+                       &relayd->id, &iter);
        node = lttng_ht_iter_get_node_u64(&iter);
        if (node != NULL) {
                goto end;
@@ -712,12 +711,12 @@ end:
  * Allocate and return a consumer relayd socket.
  */
 static struct consumer_relayd_sock_pair *consumer_allocate_relayd_sock_pair(
-               uint64_t net_seq_idx)
+               uint64_t relayd_id)
 {
        struct consumer_relayd_sock_pair *obj = NULL;
 
        /* net sequence index of -1 is a failure */
-       if (net_seq_idx == (uint64_t) -1ULL) {
+       if (relayd_id == (uint64_t) -1ULL) {
                goto error;
        }
 
@@ -727,12 +726,12 @@ static struct consumer_relayd_sock_pair *consumer_allocate_relayd_sock_pair(
                goto error;
        }
 
-       obj->net_seq_idx = net_seq_idx;
+       obj->id = relayd_id;
        obj->refcount = 0;
        obj->destroy_flag = 0;
        obj->control_sock.sock.fd = -1;
        obj->data_sock.sock.fd = -1;
-       lttng_ht_node_init_u64(&obj->node, obj->net_seq_idx);
+       lttng_ht_node_init_u64(&obj->node, obj->id);
        pthread_mutex_init(&obj->ctrl_sock_mutex, NULL);
 
 error:
@@ -780,12 +779,12 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream,
        struct consumer_relayd_sock_pair *relayd;
 
        assert(stream);
-       assert(stream->net_seq_idx != -1ULL);
+       assert(stream->relayd_id != -1ULL);
        assert(path);
 
        /* The stream is not metadata. Get relayd reference if exists. */
        rcu_read_lock();
-       relayd = consumer_find_relayd(stream->net_seq_idx);
+       relayd = consumer_find_relayd(stream->relayd_id);
        if (relayd != NULL) {
                /* Add stream on the relayd */
                pthread_mutex_lock(&relayd->ctrl_sock_mutex);
@@ -794,7 +793,7 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream,
                                stream->chan->tracefile_size, stream->chan->tracefile_count);
                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                if (ret < 0) {
-                       ERR("Relayd add stream failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                       ERR("Relayd add stream failed. Cleaning up relayd %" PRIu64".", relayd->id);
                        lttng_consumer_cleanup_relayd(relayd);
                        goto end;
                }
@@ -803,13 +802,13 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream,
                stream->sent_to_relayd = 1;
        } else {
                ERR("Stream %" PRIu64 " relayd ID %" PRIu64 " unknown. Can't send it.",
-                               stream->key, stream->net_seq_idx);
+                               stream->key, stream->relayd_id);
                ret = -1;
                goto end;
        }
 
        DBG("Stream %s with key %" PRIu64 " sent to relayd id %" PRIu64,
-                       stream->name, stream->key, stream->net_seq_idx);
+                       stream->name, stream->key, stream->relayd_id);
 
 end:
        rcu_read_unlock();
@@ -821,35 +820,35 @@ end:
  *
  * Returns 0 on success, < 0 on error
  */
-int consumer_send_relayd_streams_sent(uint64_t net_seq_idx)
+int consumer_send_relayd_streams_sent(uint64_t relayd_id)
 {
        int ret = 0;
        struct consumer_relayd_sock_pair *relayd;
 
-       assert(net_seq_idx != -1ULL);
+       assert(relayd_id != -1ULL);
 
        /* The stream is not metadata. Get relayd reference if exists. */
        rcu_read_lock();
-       relayd = consumer_find_relayd(net_seq_idx);
+       relayd = consumer_find_relayd(relayd_id);
        if (relayd != NULL) {
                /* Add stream on the relayd */
                pthread_mutex_lock(&relayd->ctrl_sock_mutex);
                ret = relayd_streams_sent(&relayd->control_sock);
                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                if (ret < 0) {
-                       ERR("Relayd streams sent failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                       ERR("Relayd streams sent failed. Cleaning up relayd %" PRIu64".", relayd->id);
                        lttng_consumer_cleanup_relayd(relayd);
                        goto end;
                }
        } else {
                ERR("Relayd ID %" PRIu64 " unknown. Can't send streams_sent.",
-                               net_seq_idx);
+                               relayd_id);
                ret = -1;
                goto end;
        }
 
        ret = 0;
-       DBG("All streams sent relayd id %" PRIu64, net_seq_idx);
+       DBG("All streams sent relayd id %" PRIu64, relayd_id);
 
 end:
        rcu_read_unlock();
@@ -865,7 +864,7 @@ void close_relayd_stream(struct lttng_consumer_stream *stream)
 
        /* The stream is not metadata. Get relayd reference if exists. */
        rcu_read_lock();
-       relayd = consumer_find_relayd(stream->net_seq_idx);
+       relayd = consumer_find_relayd(stream->relayd_id);
        if (relayd) {
                consumer_stream_relayd_close(stream, relayd);
        }
@@ -1525,8 +1524,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap(
        rcu_read_lock();
 
        /* Flag that the current stream if set for network streaming. */
-       if (stream->net_seq_idx != (uint64_t) -1ULL) {
-               relayd = consumer_find_relayd(stream->net_seq_idx);
+       if (stream->relayd_id != (uint64_t) -1ULL) {
+               relayd = consumer_find_relayd(stream->relayd_id);
                if (relayd == NULL) {
                        ret = -EPIPE;
                        goto end;
@@ -1704,7 +1703,7 @@ write_error:
         * cleanup the relayd object and all associated streams.
         */
        if (relayd && relayd_hang_up) {
-               ERR("Relayd hangup. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+               ERR("Relayd hangup. Cleaning up relayd %" PRIu64".", relayd->id);
                lttng_consumer_cleanup_relayd(relayd);
        }
 
@@ -1757,8 +1756,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice(
        rcu_read_lock();
 
        /* Flag that the current stream if set for network streaming. */
-       if (stream->net_seq_idx != (uint64_t) -1ULL) {
-               relayd = consumer_find_relayd(stream->net_seq_idx);
+       if (stream->relayd_id != (uint64_t) -1ULL) {
+               relayd = consumer_find_relayd(stream->relayd_id);
                if (relayd == NULL) {
                        written = -ret;
                        goto end;
@@ -1931,7 +1930,7 @@ write_error:
         * cleanup the relayd object and all associated streams.
         */
        if (relayd && relayd_hang_up) {
-               ERR("Relayd hangup. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+               ERR("Relayd hangup. Cleaning up relayd %" PRIu64".", relayd->id);
                lttng_consumer_cleanup_relayd(relayd);
                /* Skip splice error so the consumer does not fail */
                goto end;
@@ -3355,7 +3354,7 @@ error:
  * This will create a relayd socket pair and add it to the relayd hash table.
  * The caller MUST acquire a RCU read side lock before calling it.
  */
- void consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
+ void consumer_add_relayd_socket(uint64_t relayd_id, int sock_type,
                struct lttng_consumer_local_data *ctx, int sock,
                struct pollfd *consumer_sockpoll,
                struct lttcomm_relayd_sock *relayd_sock, uint64_t sessiond_id,
@@ -3368,14 +3367,14 @@ error:
        assert(ctx);
        assert(relayd_sock);
 
-       DBG("Consumer adding relayd socket (idx: %" PRIu64 ")", net_seq_idx);
+       DBG("Consumer adding relayd socket (idx: %" PRIu64 ")", relayd_id);
 
        /* Get relayd reference if exists. */
-       relayd = consumer_find_relayd(net_seq_idx);
+       relayd = consumer_find_relayd(relayd_id);
        if (relayd == NULL) {
                assert(sock_type == LTTNG_STREAM_CONTROL);
                /* Not found. Allocate one. */
-               relayd = consumer_allocate_relayd_sock_pair(net_seq_idx);
+               relayd = consumer_allocate_relayd_sock_pair(relayd_id);
                if (relayd == NULL) {
                        ret = -ENOMEM;
                        ret_code = LTTCOMM_CONSUMERD_ENOMEM;
@@ -3498,7 +3497,7 @@ error:
 
        DBG("Consumer %s socket created successfully with net idx %" PRIu64 " (fd: %d)",
                        sock_type == LTTNG_STREAM_CONTROL ? "control" : "data",
-                       relayd->net_seq_idx, fd);
+                       relayd->id, fd);
 
        /* We successfully added the socket. Send status back. */
        ret = consumer_send_status_msg(sock, ret_code);
@@ -3547,7 +3546,7 @@ static struct consumer_relayd_sock_pair *find_relayd_by_session_id(uint64_t id)
        struct lttng_ht_iter iter;
        struct consumer_relayd_sock_pair *relayd = NULL;
 
-       /* Iterate over all relayd since they are indexed by net_seq_idx. */
+       /* Iterate over all relayd since they are indexed by relayd_id. */
        cds_lfht_for_each_entry(consumer_data.relayd_ht->ht, &iter.iter, relayd,
                        node.node) {
                /*
@@ -3638,7 +3637,7 @@ int consumer_data_pending(uint64_t id)
                if (ret < 0) {
                        /* Communication error thus the relayd so no data pending. */
                        pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
-                       ERR("Relayd begin data pending failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                       ERR("Relayd begin data pending failed. Cleaning up relayd %" PRIu64".", relayd->id);
                        lttng_consumer_cleanup_relayd(relayd);
                        goto data_not_pending;
                }
@@ -3661,7 +3660,7 @@ int consumer_data_pending(uint64_t id)
                                goto data_pending;
                        }
                        if (ret < 0) {
-                               ERR("Relayd data pending failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                               ERR("Relayd data pending failed. Cleaning up relayd %" PRIu64".", relayd->id);
                                lttng_consumer_cleanup_relayd(relayd);
                                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                                pthread_mutex_unlock(&stream->lock);
@@ -3674,7 +3673,7 @@ int consumer_data_pending(uint64_t id)
                                relayd->relayd_session_id, &is_data_inflight);
                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                if (ret < 0) {
-                       ERR("Relayd end data pending failed. Cleaning up relayd %" PRIu64".", relayd->net_seq_idx);
+                       ERR("Relayd end data pending failed. Cleaning up relayd %" PRIu64".", relayd->id);
                        lttng_consumer_cleanup_relayd(relayd);
                        goto data_not_pending;
                }
index 07197c598fd916f8b0818bbec70ee507fd7503e8..ab59e6e757ffba375e7ebb71cd0ab7b1ef91d9b4 100644 (file)
@@ -302,8 +302,11 @@ struct lttng_consumer_stream {
        /* UID/GID of the user owning the session to which stream belongs */
        uid_t uid;
        gid_t gid;
-       /* Network sequence number. Indicating on which relayd socket it goes. */
-       uint64_t net_seq_idx;
+       /*
+        * Relayd id, indicating on which relayd socket it goes. Set to -1ULL if
+        * not the stream is not associated to a relay daemon.
+        */
+       uint64_t relayd_id;
        /*
         * Indicate if this stream was successfully sent to a relayd. This is set
         * after the refcount of the relayd is incremented and is checked when the
@@ -421,7 +424,7 @@ struct lttng_consumer_stream {
  */
 struct consumer_relayd_sock_pair {
        /* Network sequence number. */
-       uint64_t net_seq_idx;
+       uint64_t id;
        /* Number of stream associated with this relayd */
        int refcount;
 
@@ -679,7 +682,7 @@ void consumer_del_channel(struct lttng_consumer_channel *channel);
 /* lttng-relayd consumer command */
 struct consumer_relayd_sock_pair *consumer_find_relayd(uint64_t key);
 int consumer_send_relayd_stream(struct lttng_consumer_stream *stream, char *path);
-int consumer_send_relayd_streams_sent(uint64_t net_seq_idx);
+int consumer_send_relayd_streams_sent(uint64_t relayd_id);
 void close_relayd_stream(struct lttng_consumer_stream *stream);
 struct lttng_consumer_channel *consumer_find_channel(uint64_t key);
 int consumer_handle_stream_before_relayd(struct lttng_consumer_stream *stream,
@@ -719,7 +722,7 @@ int lttng_consumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                struct lttng_consumer_local_data *ctx);
 int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream);
-void consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
+void consumer_add_relayd_socket(uint64_t relayd_id, int sock_type,
                struct lttng_consumer_local_data *ctx, int sock,
                struct pollfd *consumer_sockpoll, struct lttcomm_relayd_sock *relayd_sock,
                uint64_t sessiond_id, uint64_t relayd_session_id);
index e874103664d20fec950be3e82288c9996eb5fe7f..0a232dcfc0bd5a430746407f57c557250f005db9 100644 (file)
@@ -154,7 +154,7 @@ int lttng_kconsumer_snapshot_channel(uint64_t key, char *path,
                 * Assign the received relayd ID so we can use it for streaming. The streams
                 * are not visible to anyone so this is OK to change it.
                 */
-               stream->net_seq_idx = relayd_id;
+               stream->relayd_id = relayd_id;
                channel->relayd_id = relayd_id;
                if (relayd_id != (uint64_t) -1ULL) {
                        ret = consumer_send_relayd_stream(stream, path);
@@ -305,7 +305,7 @@ int lttng_kconsumer_snapshot_channel(uint64_t key, char *path,
                        }
                } else {
                        close_relayd_stream(stream);
-                       stream->net_seq_idx = (uint64_t) -1ULL;
+                       stream->relayd_id = (uint64_t) -1ULL;
                }
                pthread_mutex_unlock(&stream->lock);
        }
@@ -396,7 +396,7 @@ static int lttng_kconsumer_snapshot_metadata(uint64_t key, char *path,
 
        if (use_relayd) {
                close_relayd_stream(metadata_stream);
-               metadata_stream->net_seq_idx = (uint64_t) -1ULL;
+               metadata_stream->relayd_id = (uint64_t) -1ULL;
        } else {
                if (metadata_stream->out_fd >= 0) {
                        ret = close(metadata_stream->out_fd);
@@ -701,13 +701,13 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                if (!channel->monitor) {
                        DBG("Kernel consumer add stream %s in no monitor mode with "
                                        "relayd id %" PRIu64, new_stream->name,
-                                       new_stream->net_seq_idx);
+                                       new_stream->relayd_id);
                        cds_list_add(&new_stream->send_node, &channel->streams.head);
                        break;
                }
 
                /* Send stream to relayd if the stream has an ID. */
-               if (new_stream->net_seq_idx != (uint64_t) -1ULL) {
+               if (new_stream->relayd_id != (uint64_t) -1ULL) {
                        ret = consumer_send_relayd_stream(new_stream,
                                        new_stream->chan->pathname);
                        if (ret < 0) {
@@ -722,7 +722,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                         */
                        if (channel->streams_sent_to_relayd) {
                                ret = consumer_send_relayd_streams_sent(
-                                               new_stream->net_seq_idx);
+                                               new_stream->relayd_id);
                                if (ret < 0) {
                                        goto end_nosignal;
                                }
@@ -1419,8 +1419,8 @@ ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
                 * network streaming or the full padding (len) size when we are _not_
                 * streaming.
                 */
-               if ((ret != subbuf_size && stream->net_seq_idx != (uint64_t) -1ULL) ||
-                               (ret != len && stream->net_seq_idx == (uint64_t) -1ULL)) {
+               if ((ret != subbuf_size && stream->relayd_id != (uint64_t) -1ULL) ||
+                               (ret != len && stream->relayd_id == (uint64_t) -1ULL)) {
                        /*
                         * Display the error but continue processing to try to release the
                         * subbuffer. This is a DBG statement since this is possible to
@@ -1498,7 +1498,7 @@ int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
         * Don't create anything if this is set for streaming or should not be
         * monitored.
         */
-       if (stream->net_seq_idx == (uint64_t) -1ULL && stream->chan->monitor) {
+       if (stream->relayd_id == (uint64_t) -1ULL && stream->chan->monitor) {
                ret = utils_create_stream_file(stream->chan->pathname, stream->name,
                                stream->chan->tracefile_size, stream->tracefile_count_current,
                                stream->uid, stream->gid, NULL);
index 4277372afdd2e874e5fc643568eb0720f6b51018..4d0b530a7ce798e5fe0295dbe6a1caf1a5ddabf0 100644 (file)
@@ -553,7 +553,7 @@ static int send_sessiond_channel(int sock,
 {
        int ret, ret_code = LTTCOMM_CONSUMERD_SUCCESS;
        struct lttng_consumer_stream *stream;
-       uint64_t net_seq_idx = -1ULL;
+       uint64_t relayd_id = -1ULL;
 
        assert(channel);
        assert(ctx);
@@ -578,8 +578,8 @@ static int send_sessiond_channel(int sock,
                                }
                                ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
                        }
-                       if (net_seq_idx == -1ULL) {
-                               net_seq_idx = stream->net_seq_idx;
+                       if (relayd_id == -1ULL) {
+                               relayd_id = stream->relayd_id;
                        }
                }
        }
@@ -939,7 +939,7 @@ static int setup_metadata(struct lttng_consumer_local_data *ctx, uint64_t key)
        }
 
        /* Send metadata stream to relayd if needed. */
-       if (metadata->metadata_stream->net_seq_idx != (uint64_t) -1ULL) {
+       if (metadata->metadata_stream->relayd_id != (uint64_t) -1ULL) {
                ret = consumer_send_relayd_stream(metadata->metadata_stream,
                                metadata->pathname);
                if (ret < 0) {
@@ -947,7 +947,7 @@ static int setup_metadata(struct lttng_consumer_local_data *ctx, uint64_t key)
                        goto error;
                }
                ret = consumer_send_relayd_streams_sent(
-                               metadata->metadata_stream->net_seq_idx);
+                               metadata->metadata_stream->relayd_id);
                if (ret < 0) {
                        ret = LTTCOMM_CONSUMERD_RELAYD_FAIL;
                        goto error;
@@ -1039,7 +1039,7 @@ static int snapshot_metadata(uint64_t key, char *path, uint64_t relayd_id,
        assert(metadata_stream);
 
        if (relayd_id != (uint64_t) -1ULL) {
-               metadata_stream->net_seq_idx = relayd_id;
+               metadata_stream->relayd_id = relayd_id;
                ret = consumer_send_relayd_stream(metadata_stream, path);
                if (ret < 0) {
                        goto error_stream;
@@ -1116,7 +1116,7 @@ static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id,
 
                /* Lock stream because we are about to change its state. */
                pthread_mutex_lock(&stream->lock);
-               stream->net_seq_idx = relayd_id;
+               stream->relayd_id = relayd_id;
 
                if (use_relayd) {
                        ret = consumer_send_relayd_stream(stream, path);
@@ -2545,8 +2545,8 @@ retry:
         * The mmap operation should write subbuf_size amount of data when network
         * streaming or the full padding (len) size when we are _not_ streaming.
         */
-       if ((ret != subbuf_size && stream->net_seq_idx != (uint64_t) -1ULL) ||
-                       (ret != len && stream->net_seq_idx == (uint64_t) -1ULL)) {
+       if ((ret != subbuf_size && stream->relayd_id != (uint64_t) -1ULL) ||
+                       (ret != len && stream->relayd_id == (uint64_t) -1ULL)) {
                /*
                 * Display the error but continue processing to try to release the
                 * subbuffer. This is a DBG statement since any unexpected kill or
@@ -2627,7 +2627,7 @@ int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
        assert(stream);
 
        /* Don't create anything if this is set for streaming. */
-       if (stream->net_seq_idx == (uint64_t) -1ULL && stream->chan->monitor) {
+       if (stream->relayd_id == (uint64_t) -1ULL && stream->chan->monitor) {
                ret = utils_create_stream_file(stream->chan->pathname, stream->name,
                                stream->chan->tracefile_size, stream->tracefile_count_current,
                                stream->uid, stream->gid, NULL);
This page took 0.048854 seconds and 5 git commands to generate.