Pass the consumerd stream's trace archive id to the relayd
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 10 May 2018 19:00:34 +0000 (15:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Jun 2018 16:16:05 +0000 (12:16 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/cmd-2-11.c
src/bin/lttng-relayd/cmd-2-11.h
src/bin/lttng-relayd/main.c
src/common/consumer/consumer.c
src/common/relayd/relayd.c
src/common/relayd/relayd.h
src/common/sessiond-comm/relayd.h

index eb03999cf9a4aac73b6cf0650e3bad118e3aaa14..e2d71a0d1351f848a1df2493b6554e737b303278 100644 (file)
@@ -112,7 +112,8 @@ error:
  */
 int cmd_recv_stream_2_11(const struct lttng_buffer_view *payload,
                char **ret_path_name, char **ret_channel_name,
-               uint64_t *tracefile_size, uint64_t *tracefile_count)
+               uint64_t *tracefile_size, uint64_t *tracefile_count,
+               uint64_t *trace_archive_id)
 {
        int ret;
        struct lttcomm_relayd_add_stream_2_11 header;
@@ -136,6 +137,7 @@ int cmd_recv_stream_2_11(const struct lttng_buffer_view *payload,
        header.pathname_len = be32toh(header.pathname_len);
        header.tracefile_size = be64toh(header.tracefile_size);
        header.tracefile_count = be64toh(header.tracefile_count);
+       header.trace_archive_id = be64toh(header.trace_archive_id);
 
        received_names_size = header.channel_name_len + header.pathname_len;
        if (payload->size < header_len + received_names_size) {
@@ -191,6 +193,7 @@ int cmd_recv_stream_2_11(const struct lttng_buffer_view *payload,
 
        *tracefile_size = header.tracefile_size;
        *tracefile_count = header.tracefile_count;
+       *trace_archive_id = header.trace_archive_id;
        *ret_path_name = path_name;
        *ret_channel_name = channel_name;
        /* Move ownership to caller */
index e17eedf3c00204ee1af57029fb7788b5dc75c2ab..a50872bd360773a44a5bb48e977809c3e10bd624 100644 (file)
@@ -26,6 +26,7 @@ int cmd_create_session_2_11(const struct lttng_buffer_view *payload,
 
 int cmd_recv_stream_2_11(const struct lttng_buffer_view *payload,
                char **ret_path_name, char **ret_channel_name,
-               uint64_t *tracefile_size, uint64_t *tracefile_count);
+               uint64_t *tracefile_size, uint64_t *tracefile_count,
+               uint64_t *trace_archive_id);
 
 #endif /* RELAYD_CMD_2_11_H */
index fcc7fc00ae55c844b935ef065028e3526c384257..a04303e4f5814a47a1b7bce3eec973179f6d3866 100644 (file)
@@ -1216,7 +1216,9 @@ static int relay_add_stream(const struct lttcomm_relayd_hdr *recv_hdr,
        } else {
                /* From 2.11 to ... */
                ret = cmd_recv_stream_2_11(payload, &path_name,
-                       &channel_name, &tracefile_size, &tracefile_count);
+                       &channel_name, &tracefile_size, &tracefile_count,
+                       &stream_chunk_id.value);
+               stream_chunk_id.is_set = true;
        }
 
        if (ret < 0) {
index 3e991c8c71035f6ee9f43f768db27247209e8707..afc346333c5dc780a57c2bb86a548a9b0c60d82f 100644 (file)
@@ -808,7 +808,8 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream,
                pthread_mutex_lock(&relayd->ctrl_sock_mutex);
                ret = relayd_add_stream(&relayd->control_sock, stream->name,
                                path, &stream->relayd_stream_id,
-                               stream->chan->tracefile_size, stream->chan->tracefile_count);
+                               stream->chan->tracefile_size, stream->chan->tracefile_count,
+                               stream->trace_archive_id);
                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
                if (ret < 0) {
                        goto end;
index 53ee58b2edcdc89464ceae7d610702e7ff0f4085..b88a536b95a7b6d5edd95d6096959b4806f821cc 100644 (file)
@@ -404,7 +404,8 @@ error:
  */
 int relayd_add_stream(struct lttcomm_relayd_sock *rsock, const char *channel_name,
                const char *pathname, uint64_t *stream_id,
-               uint64_t tracefile_size, uint64_t tracefile_count)
+               uint64_t tracefile_size, uint64_t tracefile_count,
+               uint64_t trace_archive_id)
 {
        int ret;
        struct lttcomm_relayd_status_stream reply;
index fb3e94224caf456daa8b0c1af7038d38c6d0e5e2..9353fc2d78440b64e29af8e753a61778afca270f 100644 (file)
@@ -30,7 +30,8 @@ int relayd_create_session(struct lttcomm_relayd_sock *sock, uint64_t *session_id
                unsigned int snapshot);
 int relayd_add_stream(struct lttcomm_relayd_sock *sock, const char *channel_name,
                const char *pathname, uint64_t *stream_id,
-               uint64_t tracefile_size, uint64_t tracefile_count);
+               uint64_t tracefile_size, uint64_t tracefile_count,
+               uint64_t trace_archive_id);
 int relayd_streams_sent(struct lttcomm_relayd_sock *rsock);
 int relayd_send_close_stream(struct lttcomm_relayd_sock *sock, uint64_t stream_id,
                uint64_t last_net_seq_num);
index 1a58d5989e6358b68fbfd50f15d8e750a1bb8891..b09dd138dfb4777f46b533a694e21f19f2e93c8e 100644 (file)
@@ -89,6 +89,7 @@ struct lttcomm_relayd_add_stream_2_11 {
        uint32_t pathname_len;
        uint64_t tracefile_size;
        uint64_t tracefile_count;
+       uint64_t trace_archive_id;
        char names[];
 } LTTNG_PACKED;
 
This page took 0.041053 seconds and 4 git commands to generate.