X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=4153612746f90c84780b208b94ce2ce731126217;hb=8f0044bfed9f5ca51eab51478f483f92cc8f84a7;hp=4c069588a36cf36ce8755433f2f03c480df06ba4;hpb=a4baae1b0463bc4ce65c2a458c4a941e7fabc594;p=lttng-tools.git 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");