Steven Rostedt (Google) bd604f3db4 ftrace: Avoid needless updates of the ftrace function call
Song Shuai reported:

    The list func (ftrace_ops_list_func) will be patched first
    before the transition between old and new calls are set,
    which fixed the race described in this commit `59338f75`.

    While ftrace_trace_function changes from the list func to a
    ftrace_ops func, like unregistering the klp_ops to leave the only
    global_ops in ftrace_ops_list, the ftrace_[regs]_call will be
    replaced with the list func although it already exists. So there
    should be a condition to avoid this.

And suggested using another variable to keep track of what the ftrace
function is set to. But this could be simplified by using a helper
function that does the same with a static variable.

Link: https://lore.kernel.org/lkml/20221026132039.2236233-1-suagrfillet@gmail.com/
Link: https://lore.kernel.org/linux-trace-kernel/20221122180905.737b6f52@gandalf.local.home

Reported-by: Song Shuai <suagrfillet@gmail.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2022-11-23 19:08:31 -05:00
..
2022-10-17 18:52:43 -07:00
2022-09-28 09:02:20 +02:00
2022-09-26 19:46:18 -07:00
2022-10-10 11:36:19 -07:00
2022-11-14 09:58:32 +01:00
2022-08-29 19:47:03 -04:00
2022-10-04 11:05:43 -07:00
2022-09-26 10:13:13 -07:00
2022-05-23 17:51:12 -07:00
2022-10-03 17:11:07 -07:00
2022-09-01 16:55:35 +02:00
2022-06-29 13:07:16 +02:00
2022-10-10 09:10:28 -07:00
2022-10-10 12:49:34 -07:00
2022-08-06 16:38:17 -07:00
2022-10-03 17:11:07 -07:00