Thread (12 messages) 12 messages, 2 authors, 2025-02-19

Re: [PATCH 3/5] fprobe: Fix accounting of when to unregister from function graph

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2025-02-19 14:45:27
Also in: lkml, stable

On Wed, 19 Feb 2025 09:53:32 +0900
Masami Hiramatsu (Google) [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Can you use this version?
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index 2560b312ad57..7d282c08549e 100644
--- a/kernel/trace/fprobe.c
+++ b/kernel/trace/fprobe.c
@@ -409,7 +409,8 @@ static void fprobe_graph_remove_ips(unsigned long *addrs, int num)
 		return;
 	}
 
-	ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0);
+	if (num)
+		ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0);
 }
 
 static int symbols_cmp(const void *a, const void *b)
@@ -679,8 +680,7 @@ int unregister_fprobe(struct fprobe *fp)
 	}
 	del_fprobe_hash(fp);
 
-	if (count)
-		fprobe_graph_remove_ips(addrs, count);
+	fprobe_graph_remove_ips(addrs, count);
 
 	kfree_rcu(hlist_array, rcu);
 	fp->hlist_array = NULL;
Yes, that looks better. I'll add that to v2.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help