Skip to contentSkip to conversation

fprobe: Simplify fprobe_remove_ips() by reusing existing helpers

PATCH In review Masami Hiramatsu (Google) 2 participants 2 messages Jul 28 – Aug 8 Tracing

lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 fprobe: Simplify fprobe_remove_ips() by reusing existing helpers

From: Masami Hiramatsu (Google) <[email protected]>

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
---
 kernel/trace/fprobe.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
kernel/trace/fprobe.c +2 -9
index f681015413b8..54256586fde3 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Wed, 29 Jul 2026 08:29:58 +0900 "Masami Hiramatsu (Google)"…

From: Masami Hiramatsu (Google) <[email protected]>

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

---

-- Steve