From: Steven Rostedt <rostedt@goodmis.org>
To: Song Shuai <suagrfillet@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] ftrace: Avoid needless updates of the ftrace function call
Date: Tue, 22 Nov 2022 22:17:11 -0500 [thread overview]
Message-ID: <20221122221711.402b360f@rorschach.local.home> (raw)
In-Reply-To: <CAAYs2=jdy7zrRDyTidUW1tFbKDLycLOZjSDt0_Ra7CbB6O1L2Q@mail.gmail.com>
On Wed, 23 Nov 2022 10:29:28 +0800
Song Shuai <suagrfillet@gmail.com> wrote:
> > @@ -2783,7 +2796,7 @@ void ftrace_modify_all_code(int command)
> > * traced.
> > */
> > if (update) {
> > - err = ftrace_update_ftrace_func(ftrace_ops_list_func);
> > + err = update_ftrace_func(ftrace_ops_list_func);
> > if (FTRACE_WARN_ON(err))
> > return;
> > }
> > @@ -2799,7 +2812,7 @@ void ftrace_modify_all_code(int command)
> > /* If irqs are disabled, we are in stop machine */
> > if (!irqs_disabled())
> > smp_call_function(ftrace_sync_ipi, NULL, 1);
> > - err = ftrace_update_ftrace_func(ftrace_trace_function);
> > + err = update_ftrace_func(ftrace_trace_function);
> The helper function should only serve the ftrace_ops_list_func.
>
> And ftrace_trace_function is always different in this function with
> FTRACE_UPDATE_TRACE_FUNC command.
>
> So this place should be left as it is.
But it is needed to update the static variable. Without this change,
then save_func will get set to ftrace_ops_list_func and never change
after that and then the update to ftrace_ops_list_func will stop happening.
-- Steve
next prev parent reply other threads:[~2022-11-23 3:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 23:09 [PATCH] ftrace: Avoid needless updates of the ftrace function call Steven Rostedt
[not found] ` <CAAYs2=jdy7zrRDyTidUW1tFbKDLycLOZjSDt0_Ra7CbB6O1L2Q@mail.gmail.com>
2022-11-23 3:17 ` Steven Rostedt [this message]
2022-11-23 5:31 ` Song Shuai
2022-11-23 15:30 ` 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=20221122221711.402b360f@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=suagrfillet@gmail.com \
/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