Thread (5 messages) 5 messages, 3 authors, 2025-01-29
STALE505d LANDED: 3 (3M)

[PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock()

From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Date: 2025-01-28 15:29:43
Also in: bpf, linux-s390, lkml
Subsystem: function hooks (ftrace), s390 architecture, the rest · Maintainers: Steven Rostedt, Masami Hiramatsu, Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Linus Torvalds

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

Fix to remove ftrace_test_recursion_trylock() from ftrace_graph_func()
because commit d576aec24df9 ("fgraph: Get ftrace recursion lock in
function_graph_enter") has been moved it to function_graph_enter_regs()
already.

Reported-by: Jiri Olsa <redacted>
Closes: https://lore.kernel.org/all/Z5O0shrdgeExZ2kF@krava/ (local)
Fixes: d576aec24df9 ("fgraph: Get ftrace recursion lock in function_graph_enter")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Tested-by: Jiri Olsa <jolsa@kernel.org>
---
 arch/s390/kernel/ftrace.c |    5 -----
 1 file changed, 5 deletions(-)
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index c0b2c97efefb..63ba6306632e 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -266,18 +266,13 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
 		       struct ftrace_ops *op, struct ftrace_regs *fregs)
 {
 	unsigned long *parent = &arch_ftrace_regs(fregs)->regs.gprs[14];
-	int bit;
 
 	if (unlikely(ftrace_graph_is_dead()))
 		return;
 	if (unlikely(atomic_read(&current->tracing_graph_pause)))
 		return;
-	bit = ftrace_test_recursion_trylock(ip, *parent);
-	if (bit < 0)
-		return;
 	if (!function_graph_enter_regs(*parent, ip, 0, parent, fregs))
 		*parent = (unsigned long)&return_to_handler;
-	ftrace_test_recursion_unlock(bit);
 }
 
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help