X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=067652b811def6d6a65a4604c88b8b1f5cd82873;hb=e99f9447b5be2deee54dde16b404a12b3fcd88ee;hp=a65e1493c384ea75401266b019b56ab605ce7e89;hpb=1cfb4b98d79d3dd709037ee6827f238a5616832a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index a65e1493c..067652b81 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -338,7 +338,7 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock, struct ltt_kernel_channel *channel, struct ltt_kernel_session *session, unsigned int monitor) { - int ret; + int ret = LTTNG_OK; struct ltt_kernel_stream *stream; /* Safety net */ @@ -356,9 +356,12 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock, DBG("Sending streams of channel %s to kernel consumer", channel->channel->name); - ret = kernel_consumer_add_channel(sock, channel, session, monitor); - if (ret < 0) { - goto error; + if (!channel->sent_to_consumer) { + ret = kernel_consumer_add_channel(sock, channel, session, monitor); + if (ret < 0) { + goto error; + } + channel->sent_to_consumer = true; } /* Send streams */