public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux trace kernel <linux-trace-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] fgraph: Use CPU hotplug mechanism to initialize idle shadow stacks
Date: Wed, 11 Dec 2024 08:24:27 +0900	[thread overview]
Message-ID: <20241211082427.01208632d3dd5486abb3e090@kernel.org> (raw)
In-Reply-To: <CACRpkdaTBrHwRbbrphVy-=SeDz6MSsXhTKypOtLrTQ+DgGAOcQ@mail.gmail.com>

On Tue, 10 Dec 2024 16:11:16 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:

> Hi Stephen,
> 
> On Sat, Oct 19, 2024 at 3:43 AM Steven Rostedt <rostedt@goodmis.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@vger.kernel.org
> > Fixes: 868baf07b1a25 ("ftrace: Fix memory leak with function graph and cpu hotplug")
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.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@kernel.org>

  parent reply	other threads:[~2024-12-10 23:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-19  1:43 [PATCH] fgraph: Use CPU hotplug mechanism to initialize idle shadow stacks Steven Rostedt
2024-10-21  5:58 ` Masami Hiramatsu
2024-10-22  3:35   ` Steven Rostedt
2024-10-25  1:30   ` Steven Rostedt
2024-12-10 15:11 ` Linus Walleij
2024-12-10 16:31   ` Steven Rostedt
2024-12-10 23:24   ` Masami Hiramatsu [this message]
2024-12-11 14:23     ` Linus Walleij
2024-12-11 16:09       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241211082427.01208632d3dd5486abb3e090@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox