Skip to content

Commit 7cec88b

Browse files
hbathinimaddy-kerneldev
authored andcommitted
powerpc/fprobe: fix updated fprobe for function-graph tracer
Since commit 4346ba1 ("fprobe: Rewrite fprobe on function-graph tracer"), FPROBE depends on HAVE_FUNCTION_GRAPH_FREGS. With previous patch adding HAVE_FUNCTION_GRAPH_FREGS for powerpc, FPROBE can be enabled on powerpc. But with the commit b5fa903 ("fprobe: Add fprobe_header encoding feature"), asm/fprobe.h header is needed to define arch dependent encode/decode macros. The fprobe header MSB pattern on powerpc is not 0xf. So, define FPROBE_HEADER_MSB_PATTERN expected on powerpc. Also, commit 762abbc ("fprobe: Use ftrace_regs in fprobe exit handler") introduced HAVE_FTRACE_REGS_HAVING_PT_REGS for archs that have pt_regs in ftrace_regs. Advertise that on powerpc to reuse common definitions like ftrace_partial_regs(). Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Aditya Bodkhe <aditya.b1@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250916044035.29033-2-adityab1@linux.ibm.com
1 parent d733f18 commit 7cec88b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ config PPC
243243
select HAVE_EFFICIENT_UNALIGNED_ACCESS
244244
select HAVE_GUP_FAST
245245
select HAVE_FTRACE_GRAPH_FUNC
246+
select HAVE_FTRACE_REGS_HAVING_PT_REGS
246247
select HAVE_FUNCTION_ARG_ACCESS_API
247248
select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
248249
select HAVE_FUNCTION_ERROR_INJECTION

arch/powerpc/include/asm/fprobe.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_PPC_FPROBE_H
3+
#define _ASM_PPC_FPROBE_H
4+
5+
#include <asm-generic/fprobe.h>
6+
7+
#ifdef CONFIG_64BIT
8+
#undef FPROBE_HEADER_MSB_PATTERN
9+
#define FPROBE_HEADER_MSB_PATTERN (PAGE_OFFSET & ~FPROBE_HEADER_MSB_MASK)
10+
#endif
11+
12+
#endif /* _ASM_PPC_FPROBE_H */

0 commit comments

Comments
 (0)