X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=4153612746f90c84780b208b94ce2ce731126217;hp=4c069588a36cf36ce8755433f2f03c480df06ba4;hb=601262d65a9ccd90198558639ef2a73cda4230e1;hpb=2c1142ac6794479345e8f1c5d50ba1f306bb40cd diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 4c069588a..415361274 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -305,7 +305,6 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock, { int ret; struct ltt_kernel_stream *stream; - uint64_t channel_key = -1ULL; /* Safety net */ assert(channel); @@ -339,22 +338,8 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock, 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; } @@ -403,6 +388,16 @@ int kernel_consumer_send_session(struct consumer_socket *sock, 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");