]> git.ipfire.org Git - thirdparty/linux.git/commit
ftrace: Remove "filter_hash" parameter from __ftrace_hash_rec_update()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 5 Jun 2024 18:03:36 +0000 (14:03 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 6 Jun 2024 19:20:27 +0000 (15:20 -0400)
commit07bbe0833ed62f48785dffa8e429f35c1d906415
treea82dbdbd10a5d336d3a97e09744491fc263c81b6
parent3afd801f4264c7a6c84957cd3ab653cfd8f61d3e
ftrace: Remove "filter_hash" parameter from __ftrace_hash_rec_update()

While adding comments to the function __ftrace_hash_rec_update() and
trying to describe in detail what the parameter for "filter_hash" does, I
realized that it basically does exactly the same thing (but differently)
if it is set or not!

If it is set, the idea was the ops->filter_hash was being updated, and the
code should focus on the functions that are in the ops->filter_hash and
add them. But it still had to pay attention to the functions in the
ops->notrace_hash, to ignore them.

If it was cleared, it focused on the ops->notrace_hash, and would add
functions that were not in the ops->notrace_hash but would still keep
functions in the "ops->filter_hash". Basically doing the same thing.

In reality, the __ftrace_hash_rec_update() only needs to either remove the
functions associated to the give ops (if "inc" is set) or remove them (if
"inc" is cleared). It has to pay attention to both the filter_hash and
notrace_hash regardless.

Remove the "filter_hash" parameter from __filter_hash_rec_update() and
comment the function for what it really is doing.

Link: https://lore.kernel.org/linux-trace-kernel/20240605180408.691995506@goodmis.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c