Fix: sessiond: only send streams to consumer once
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 11 Jan 2017 20:49:48 +0000 (15:49 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 23 Jan 2017 22:29:48 +0000 (17:29 -0500)
Session daemon should not send streams to consumer daemon
repeatedly when CPU hotplug is performed while doing kernel
tracing.

This causes the consumer daemon to have multiple file descriptors
on the same stream, and thus try to perform operations like reading
a sub-buffer and checking for data pending concurrently. This triggers
safety-net warnings in the kernel tracer.

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 7582d80f0dea7eaf17d6d805eb680a4dbb657f15..2241acbcaa8ccdf2e6ad250a41ac2fc641ce964c 100644 (file)
@@ -338,7 +338,7 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock,
 
        /* Send streams */
        cds_list_for_each_entry(stream, &channel->stream_list.head, list) {
-               if (!stream->fd) {
+               if (!stream->fd || stream->sent_to_consumer) {
                        continue;
                }
 
@@ -348,6 +348,7 @@ int kernel_consumer_send_channel_stream(struct consumer_socket *sock,
                if (ret < 0) {
                        goto error;
                }
+               stream->sent_to_consumer = true;
        }
 
 error:
index b9bcbfa77d242d46637e229d552943819b1be371..2092469ad43b9e304f216e1a245191f05f5a0f8e 100644 (file)
@@ -84,6 +84,7 @@ struct ltt_kernel_stream {
        int fd;
        int state;
        int cpu;
+       bool sent_to_consumer;
        /* Format is %s_%d respectively channel name and CPU number. */
        char name[DEFAULT_STREAM_NAME_LEN];
        uint64_t tracefile_size;
This page took 0.02611 seconds and 4 git commands to generate.