From: Jérémie Galarneau Date: Thu, 10 May 2018 19:00:34 +0000 (-0400) Subject: Pass the consumerd stream's trace archive id to the relayd X-Git-Tag: v2.11.0-rc1~183 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0b50e4b3fb9859af7072adcca784684834e5f8d1 Pass the consumerd stream's trace archive id to the relayd Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/cmd-2-11.c b/src/bin/lttng-relayd/cmd-2-11.c index eb03999cf..e2d71a0d1 100644 --- a/src/bin/lttng-relayd/cmd-2-11.c +++ b/src/bin/lttng-relayd/cmd-2-11.c @@ -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 */ diff --git a/src/bin/lttng-relayd/cmd-2-11.h b/src/bin/lttng-relayd/cmd-2-11.h index e17eedf3c..a50872bd3 100644 --- a/src/bin/lttng-relayd/cmd-2-11.h +++ b/src/bin/lttng-relayd/cmd-2-11.h @@ -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 */ diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index fcc7fc00a..a04303e4f 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -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) { diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 3e991c8c7..afc346333 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -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; diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c index 53ee58b2e..b88a536b9 100644 --- a/src/common/relayd/relayd.c +++ b/src/common/relayd/relayd.c @@ -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; diff --git a/src/common/relayd/relayd.h b/src/common/relayd/relayd.h index fb3e94224..9353fc2d7 100644 --- a/src/common/relayd/relayd.h +++ b/src/common/relayd/relayd.h @@ -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); diff --git a/src/common/sessiond-comm/relayd.h b/src/common/sessiond-comm/relayd.h index 1a58d5989..b09dd138d 100644 --- a/src/common/sessiond-comm/relayd.h +++ b/src/common/sessiond-comm/relayd.h @@ -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;