lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] ftrace: Avoid needless updates of the ftrace function call
Steven Rostedt <rostedt@goodmis.org> 于2022年11月23日周三 03:17写道:
>
> 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
Yes, you're right. Thx for your explanation.
-- Song

\
 
 \ /
  Last update: 2022-11-23 06:34    [W:0.079 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site