From: Steven Rostedt <rostedt@goodmis.org>
To: <hu.shengming@zte.com.cn>
Cc: <mhiramat@kernel.org>, <mark.rutland@arm.com>,
<mathieu.desnoyers@efficios.com>, <linux-kernel@vger.kernel.org>,
<linux-trace-kernel@vger.kernel.org>, <zhang.run@zte.com.cn>,
<yang.tao172@zte.com.cn>, <yang.yang29@zte.com.cn>
Subject: Re: [PATCH] function_graph: restore direct mode when callbacks drop to one
Date: Thu, 12 Feb 2026 22:47:52 -0500 [thread overview]
Message-ID: <20260212224752.4311a58d@fedora> (raw)
In-Reply-To: <202602131034245558BcmEI95X7Sr39QGM8YLl@zte.com.cn>
On Fri, 13 Feb 2026 10:34:24 +0800 (CST)
<hu.shengming@zte.com.cn> wrote:
> From: Shengming Hu <hu.shengming@zte.com.cn>
>
> When registering a second fgraph callback, direct path is disabled
> and array loop is used instead.
> When ftrace_graph_active falls back to one, we try to re-enable direct
> mode via ftrace_graph_enable_direct(true, ...).
> But ftrace_graph_enable_direct() incorrectly disables the static key
> rather than enabling it.
> This leaves fgraph_do_direct permanently off after first multi-callback
> transition, so direct fast mode is never restored.
Good catch!
>
> Fixes: cc60ee813b503 ("function_graph: Use static_call and branch to optimize entry function")
> Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
> ---
> kernel/trace/fgraph.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> index cc48d16be43e..4df766c690f9 100644
> --- a/kernel/trace/fgraph.c
> +++ b/kernel/trace/fgraph.c
> @@ -1303,7 +1303,7 @@ static void ftrace_graph_enable_direct(bool enable_branch, struct fgraph_ops *go
> static_call_update(fgraph_func, func);
> static_call_update(fgraph_retfunc, retfunc);
> if (enable_branch)
> - static_branch_disable(&fgraph_do_direct);
> + static_branch_enable(&fgraph_do_direct);
> }
Your email client killed your patch. it has huge white-space damage.
But because it's such a trivial change, I'll fix it up for you. But
next time please make sure your email client doesn't corrupt your
patches.
Thanks,
-- Steve
>
> static void ftrace_graph_disable_direct(bool disable_branch)
> --
> 2.25.1
next prev parent reply other threads:[~2026-02-13 3:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 2:34 [PATCH] function_graph: restore direct mode when callbacks drop to one hu.shengming
2026-02-13 3:47 ` Steven Rostedt [this message]
2026-02-13 6:34 ` hu.shengming
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=20260212224752.4311a58d@fedora \
--to=rostedt@goodmis.org \
--cc=hu.shengming@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=yang.tao172@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=zhang.run@zte.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.