ret = -1;
goto error;
}
+
+ channel->published_to_notification_thread = true;
+
error:
free(pathname);
return ret;
/*
* Sending metadata to the consumer with command ADD_CHANNEL and ADD_STREAM.
+ *
+ * The consumer socket lock must be held by the caller.
*/
int kernel_consumer_add_metadata(struct consumer_socket *sock,
struct ltt_kernel_session *session, unsigned int monitor)
/*
* Send all stream fds of kernel channel to the consumer.
+ *
+ * The consumer socket lock must be held by the caller.
*/
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 */
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 */
/*
* Send all stream fds of the kernel session to the consumer.
+ *
+ * The consumer socket lock must be held by the caller.
*/
int kernel_consumer_send_session(struct consumer_socket *sock,
struct ltt_kernel_session *session)