Re: [PATCH] tracing: Always update snapshot buffer size

From: Steven Rostedt
Date: Tue Dec 05 2023 - 12:34:53 EST


On Tue, 5 Dec 2023 11:52:23 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
>
> It use to be that only the top level instance had a snapshot buffer (for
> latency tracers like wakeup and irqsoff). The update of the ring buffer
> size would check if the instance was the top level and if so, it would
> also update the snapshot buffer as it needs to be the same as the main
> buffer.
>
> Now that lower level instances also has a snapshot buffer, they too need
> to update their snapshot buffer sizes when the main buffer is changed,
> otherwise the following can be triggered:
>
> # cd /sys/kernel/tracing
> # echo 1500 > buffer_size_kb
> # mkdir instances/foo
> # echo irqsoff > instances/foo/current_tracer
> # echo 1000 > instances/foo/buffer_size_kb
>

Bah, this is only a partial patch, in fact it doesn't even fix the issue.
It fixes another issue that this issue is dependent on.

I'll send out a v2 shortly.

-- Steve