mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fprobe: Simplify fprobe_remove_ips() by reusing existing helpers
@ 2026-07-28 23:29 Masami Hiramatsu (Google)
  2026-08-08  0:54 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu (Google) @ 2026-07-28 23:29 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu
  Cc: Mathieu Desnoyers, linux-kernel, linux-trace-kernel

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

fprobe_remove_ips() manually duplicates the unregister and filter-removal
logic for both graph and ftrace ops. Simplify it by delegating to the
existing fprobe_graph_remove_ips() and fprobe_ftrace_remove_ips() helpers.

Assisted-by: Antigravity:gemini-3.6-flash
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 kernel/trace/fprobe.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index f681015413b8..54256586fde3 100644
--- a/kernel/trace/fprobe.c
+++ b/kernel/trace/fprobe.c
@@ -464,15 +464,8 @@ static bool fprobe_exists_on_hash(unsigned long ip, bool ftrace)
 #ifdef CONFIG_MODULES
 static void fprobe_remove_ips(unsigned long *ips, unsigned int cnt)
 {
-	if (!nr_fgraph_fprobes)
-		__fprobe_graph_unregister();
-	else if (cnt)
-		ftrace_set_filter_ips(&fprobe_graph_ops.ops, ips, cnt, 1, 0);
-
-	if (!nr_ftrace_fprobes)
-		__fprobe_ftrace_unregister();
-	else if (cnt)
-		ftrace_set_filter_ips(&fprobe_ftrace_ops, ips, cnt, 1, 0);
+	fprobe_graph_remove_ips(ips, cnt);
+	fprobe_ftrace_remove_ips(ips, cnt);
 }
 #endif
 #else


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fprobe: Simplify fprobe_remove_ips() by reusing existing helpers
  2026-07-28 23:29 [PATCH] fprobe: Simplify fprobe_remove_ips() by reusing existing helpers Masami Hiramatsu (Google)
@ 2026-08-08  0:54 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2026-08-08  0:54 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Mathieu Desnoyers, linux-kernel, linux-trace-kernel

On Wed, 29 Jul 2026 08:29:58 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> fprobe_remove_ips() manually duplicates the unregister and filter-removal
> logic for both graph and ftrace ops. Simplify it by delegating to the
> existing fprobe_graph_remove_ips() and fprobe_ftrace_remove_ips() helpers.
> 
> Assisted-by: Antigravity:gemini-3.6-flash
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---

Reviewed-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-08  0:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-28 23:29 [PATCH] fprobe: Simplify fprobe_remove_ips() by reusing existing helpers Masami Hiramatsu (Google)
2026-08-08  0:54 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®