From: Jiri Olsa <olsajiri@gmail.com>
To: Menglong Dong <menglong8.dong@gmail.com>
Cc: rostedt@goodmis.org, jolsa@redhat.com, mhiramat@kernel.org,
mark.rutland@arm.com, mathieu.desnoyers@efficios.com,
jiang.biao@linux.dev, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH] ftrace: avoid redundant initialization in register_ftrace_direct
Date: Mon, 10 Nov 2025 23:41:10 +0100 [thread overview]
Message-ID: <aRJqBkYtMAhhO1yQ@krava> (raw)
In-Reply-To: <20251110121808.1559240-1-dongml2@chinatelecom.cn>
On Mon, Nov 10, 2025 at 08:18:08PM +0800, Menglong Dong wrote:
> The FTRACE_OPS_FL_INITIALIZED flag is cleared in register_ftrace_direct,
> which can make it initialized by ftrace_ops_init() even if it is already
> initialized. It seems that there is no big deal here, but let's still fix
> it.
good catch
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
>
> Fixes: f64dd4627ec6 ("ftrace: Add multi direct register/unregister interface")
> Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
> ---
> kernel/trace/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 42bd2ba68a82..efb5ce32298f 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -6043,7 +6043,7 @@ int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr)
> new_hash = NULL;
>
> ops->func = call_direct_funcs;
> - ops->flags = MULTI_FLAGS;
> + ops->flags |= MULTI_FLAGS;
> ops->trampoline = FTRACE_REGS_ADDR;
> ops->direct_call = addr;
>
> --
> 2.51.2
>
>
next prev parent reply other threads:[~2025-11-10 22:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 12:18 [PATCH] ftrace: avoid redundant initialization in register_ftrace_direct Menglong Dong
2025-11-10 22:41 ` Jiri Olsa [this message]
2025-11-10 23:20 ` Masami Hiramatsu
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=aRJqBkYtMAhhO1yQ@krava \
--to=olsajiri@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=jiang.biao@linux.dev \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=menglong8.dong@gmail.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/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.