Fix: lttng-sessiond: cpu hotplug: send channel to consumer only once
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 May 2017 20:00:55 +0000 (16:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 May 2017 10:44:34 +0000 (06:44 -0400)
On CPU hotplug, we currently send a duplicate of the channel key, which
allocates its own object (duplicated) within the consumerd. We want the
newly added stream to map to the pre-existing channel key, so don't send
the channel duplicate.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/kernel-consumer.c
src/bin/lttng-sessiond/trace-kernel.h

index 2241acbcaa8ccdf2e6ad250a41ac2fc641ce964c..3649374efb0ae38cf6f1685df734abe7f6d28d88 100644 (file)
@@ -313,7 +313,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 */
@@ -331,9 +331,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 */
index 2092469ad43b9e304f216e1a245191f05f5a0f8e..93870cbfd6509f98e92b3ff4a4bbb5638c09aaf2 100644 (file)
@@ -71,6 +71,7 @@ struct ltt_kernel_channel {
        struct cds_list_head list;
        /* Session pointer which has a reference to this object. */
        struct ltt_kernel_session *session;
+       bool sent_to_consumer;
 };
 
 /* Metadata */
This page took 0.027791 seconds and 5 git commands to generate.