Skip to contentSkip to conversation

tracing: s390: Fix fprobes on s390

PATCH In review Masami Hiramatsu (Google) 3 participants 5 messages Jan 28, 2025 – Jan 29, 2025

Subsystems (4)
lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

cover tracing: s390: Fix fprobes on s390

Hi,

Here are fprobe and kprobe-multi fix patches for s390 which maybe broken when we introduced fprobes on fgraph series.

Thank you,

---

Masami Hiramatsu (Google) (2):
s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
s390: tracing: Define ftrace_get_symaddr() for s390

 arch/s390/include/asm/ftrace.h |    1 +
 arch/s390/kernel/ftrace.c      |    5 -----
 2 files changed, 1 insertion(+), 5 deletions(-)

--
Masami Hiramatsu (Google) <[email protected]>

author maintainer
#1 lore raw

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

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

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.

Fixes d576aec24df9 ("fgraph: Get ftrace recursion lock in function_graph_enter")
---
 arch/s390/kernel/ftrace.c |    5 -----
 1 file changed, 5 deletions(-)
arch/s390/kernel/ftrace.c +0 -5
index c0b2c97efefb..63ba6306632e 100644
@@ -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 */
author maintainer
#3 lore raw

PATCH 2/2 s390: tracing: Define ftrace_get_symaddr() for s390

In reply to Masami Hiramatsu (Google)

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

Add ftrace_get_symaddr() for s390, which returns the symbol address from ftrace's 'ip' parameter.

---
 arch/s390/include/asm/ftrace.h |    1 +
 1 file changed, 1 insertion(+)
arch/s390/include/asm/ftrace.h +1 -0
index a3b73a4f626e..185331e91f83 100644
@@ -51,6 +51,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
 	return addr;
 }
+#define ftrace_get_symaddr(fentry_ip) ((unsigned long)(fentry_ip))
 
 #include <linux/ftrace_regs.h>
 
reviewer Tested-by on v1 1/2
#2 lore raw

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

In reply to Masami Hiramatsu (Google)
Quoted 15 lines · Masami Hiramatsu (Google)

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

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.

Quoted 7 lines
Fixes d576aec24df9 ("fgraph: Get ftrace recursion lock in function_graph_enter")

[...]

Hi Masami,

Can confirm this patch fixes missed/kprobe_recursion BPF selftests on s390x:
https://github.com/kernel-patches/vmtest/actions/runs/13021621468/job/36324248903

Thanks!

maintainer Reviewed-by on the v1 series
#4 lore raw
In reply to Masami Hiramatsu (Google)
Quoted 9 lines · Masami Hiramatsu (Google)

Hi,

Here are fprobe and kprobe-multi fix patches for s390 which maybe broken when we introduced fprobes on fgraph series.

Thank you,

---

Quoted 8 lines

Masami Hiramatsu (Google) (2):
s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
s390: tracing: Define ftrace_get_symaddr() for s390

 arch/s390/include/asm/ftrace.h |    1 +
 arch/s390/kernel/ftrace.c      |    5 -----
 2 files changed, 1 insertion(+), 5 deletions(-)

For both patches: