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>
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 */
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 */
struct cds_list_head list;
/* Session pointer which has a reference to this object. */
struct ltt_kernel_session *session;
+ bool sent_to_consumer;
};
/* Metadata */