* stream message is received, this list is emptied and streams are set
* with the viewer ready flag.
*/
- if (stream->metadata_flag) {
- stream->viewer_ready = 1;
- } else {
- queue_stream_handle(stream->stream_handle, cmd);
- }
+ queue_stream_handle(stream->stream_handle, cmd);
lttng_ht_node_init_ulong(&stream->stream_n,
(unsigned long) stream->stream_handle);
{
int ret;
struct ltt_kernel_stream *stream;
- uint64_t channel_key = -1ULL;
/* Safety net */
assert(channel);
if (ret < 0) {
goto error;
}
- if (channel_key == -1ULL) {
- channel_key = channel->fd;
- }
- }
-
- if (!monitor || channel_key == -1ULL) {
- goto end;
- }
-
- /* Add stream on the kernel consumer side. */
- ret = kernel_consumer_streams_sent(sock, session, channel_key);
- if (ret < 0) {
- goto error;
}
-end:
error:
return ret;
}
if (ret < 0) {
goto error;
}
+ if (monitor) {
+ /*
+ * Inform the relay that all the streams for the
+ * channel were sent.
+ */
+ ret = kernel_consumer_streams_sent(sock, session, chan->fd);
+ if (ret < 0) {
+ goto error;
+ }
+ }
}
DBG("Kernel consumer FDs of metadata and channel streams sent");
DBG("Kernel consumer snapshot stream %s/%s (%" PRIu64 ")",
path, stream->name, stream->key);
}
- ret = consumer_send_relayd_streams_sent(relayd_id);
- if (ret < 0) {
- ERR("sending streams sent to relayd");
- goto end_unlock;
+ if (relayd_id != -1ULL) {
+ ret = consumer_send_relayd_streams_sent(relayd_id);
+ if (ret < 0) {
+ ERR("sending streams sent to relayd");
+ goto end_unlock;
+ }
}
ret = kernctl_buffer_flush(stream->wait_fd);
net_seq_idx = stream->net_seq_idx;
}
}
- ret = consumer_send_relayd_streams_sent(net_seq_idx);
- if (ret < 0) {
- /*
- * Flag that the relayd was the problem here probably due to a
- * communicaton error on the socket.
- */
- if (relayd_error) {
- *relayd_error = 1;
- }
- ret_code = LTTNG_ERR_RELAYD_CONNECT_FAIL;
- }
}
/* Inform sessiond that we are about to send channel and streams. */
ret = LTTCOMM_CONSUMERD_ERROR_METADATA;
goto error;
}
+ ret = consumer_send_relayd_streams_sent(
+ metadata->metadata_stream->net_seq_idx);
+ if (ret < 0) {
+ ret = LTTCOMM_CONSUMERD_RELAYD_FAIL;
+ goto error;
+ }
}
ret = send_streams_to_thread(metadata, ctx);