[lttng-dev] [PATCH lttng-tools 1/2] Fix: sessiond: only send streams to consumer once

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Jan 24 15:26:57 UTC 2017


Both patches were merged in master, stable-2.9 and stable-2.8.

Thanks!
Jérémie

On 11 January 2017 at 15:49, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> 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 at efficios.com>
> ---
>  src/bin/lttng-sessiond/kernel-consumer.c | 3 ++-
>  src/bin/lttng-sessiond/trace-kernel.h    | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c
> index 7582d80..b9d689f 100644
> --- a/src/bin/lttng-sessiond/kernel-consumer.c
> +++ b/src/bin/lttng-sessiond/kernel-consumer.c
> @@ -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 = 1;
>         }
>
>  error:
> diff --git a/src/bin/lttng-sessiond/trace-kernel.h b/src/bin/lttng-sessiond/trace-kernel.h
> index b9bcbfa..91672bc 100644
> --- a/src/bin/lttng-sessiond/trace-kernel.h
> +++ b/src/bin/lttng-sessiond/trace-kernel.h
> @@ -84,6 +84,7 @@ struct ltt_kernel_stream {
>         int fd;
>         int state;
>         int cpu;
> +       int sent_to_consumer;
>         /* Format is %s_%d respectively channel name and CPU number. */
>         char name[DEFAULT_STREAM_NAME_LEN];
>         uint64_t tracefile_size;
> --
> 2.1.4
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list