[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241211082427.01208632d3dd5486abb3e090@kernel.org>
Date: Wed, 11 Dec 2024 08:24:27 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, LKML
<linux-kernel@...r.kernel.org>, Linux trace kernel
<linux-trace-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Mark Rutland <mark.rutland@....com>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] fgraph: Use CPU hotplug mechanism to initialize idle
shadow stacks
On Tue, 10 Dec 2024 16:11:16 +0100
Linus Walleij <linus.walleij@...aro.org> wrote:
> Hi Stephen,
>
> On Sat, Oct 19, 2024 at 3:43 AM Steven Rostedt <rostedt@...dmis.org> wrote:
>
> > The function graph infrastructure allocates a shadow stack for every task
> > when enabled. This includes the idle tasks. The first time the function
> > graph is invoked, the shadow stacks are created and never freed until the
> > task exits. This includes the idle tasks.
> (...)
> > Cc: stable@...r.kernel.org
> > Fixes: 868baf07b1a25 ("ftrace: Fix memory leak with function graph and cpu hotplug")
> > Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
>
> This patch regressed boot-time tracing for me.
>
> How to reproduce:
> - Enable CONFIG_FTRACE, CONFIG_FUNCTION_TRACER,
> CONFIG_BOOTTIME_TRACING
> - Pass command line
> ftrace=function_graph ftrace_graph_filter=do_idle
> to make ftrace trace this function all through the boot process.
>
> Before this patch:
>
> cd /sys/kernel/debug/tracing
> cat trace
>
> gives a nice trace of all invocations of do_idle() during boot.
>
> After this patch:
>
> cd /sys/kernel/debug/tracing
> cat trace
>
> Gives an empty trace :(
>
> And:
>
> cat current_tracer
> function_graph
> cat set_graph_function
> do_idle
> cat tracing_on
> 1
>
> So all *is* set up, just not performing
>
> I tried to figure out why this happens but I'm not good with tracing
> internals. Any ideas?
Interesting. Does this happen only on boot-time tracing or after boot too?
If it does not work only for boot-time, cpuhp_setup_state() may not work
before starting boot-time function graph tracing.
Thank you,
>
> Yours,
> Linus Walleij
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists