Thread (67 messages) 67 messages, 2 authors, 2024-02-19

Re: [PATCH v7 13/36] function_graph: Have the instances use their own ftrace_ops for filtering

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2024-02-07 14:02:57
Also in: bpf, lkml

On Wed,  7 Feb 2024 00:09:54 +0900
"Masami Hiramatsu (Google)" [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/loongarch/kernel/ftrace_dyn.c b/arch/loongarch/kernel/ftrace_dyn.c
index 73858c9029cc..81d18b911cc1 100644
--- a/arch/loongarch/kernel/ftrace_dyn.c
+++ b/arch/loongarch/kernel/ftrace_dyn.c
@@ -241,10 +241,17 @@ void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent)
 void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
 		       struct ftrace_ops *op, struct ftrace_regs *fregs)
 {
+	struct fgraph_ops *gops = container_of(op, struct fgraph_ops, ops);
 	struct pt_regs *regs = &fregs->regs;
 	unsigned long *parent = (unsigned long *)&regs->regs[1];
 
-	prepare_ftrace_return(ip, (unsigned long *)parent);
+	if (unlikely(atomic_read(&current->tracing_graph_pause)))
+		return;
+
+	old = *parent;
Oops, this caused an error. 
+
+	if (!function_graph_enter_ops(old, ip, 0, parent, gops))
So this should be

if (!function_graph_enter_ops(*parent, ip, 0, parent, gops))

Thanks, 

-- 
Masami Hiramatsu (Google) [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help