Fix: lttng-sessiond: cpu hotplug: send channel to consumer only once
[lttng-tools.git] / src / bin / lttng-sessiond / kernel-consumer.c
index a65e1493c384ea75401266b019b56ab605ce7e89..067652b811def6d6a65a4604c88b8b1f5cd82873 100644 (file)
@@ -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 */
This page took 0.025179 seconds and 5 git commands to generate.