linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer
  2025-07-22  8:56 [PATCH v2 1/2] powerpc/ftrace: support CONFIG_FUNCTION_GRAPH_RETVAL Aditya Bodkhe
@ 2025-07-22  8:56 ` Aditya Bodkhe
  2025-07-26 14:15   ` Hari Bathini
  2025-08-04  7:12   ` Venkat
  0 siblings, 2 replies; 4+ messages in thread
From: Aditya Bodkhe @ 2025-07-22  8:56 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: linux-kernel, linux-trace-kernel, maddy, mpe, npiggin,
	christophe.leroy, rostedt, mhiramat, mark.rutland, venkat88,
	Hari Bathini, Aditya Bodkhe

From: Hari Bathini <hbathini@linux.ibm.com>

Since commit 4346ba160409 ("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 b5fa903b7f7c ("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 762abbc0d09f ("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().

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Aditya Bodkhe <adityab1@linux.ibm.com>
---
 arch/powerpc/Kconfig              |  1 +
 arch/powerpc/include/asm/fprobe.h | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 arch/powerpc/include/asm/fprobe.h

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9163521bc4b9..2203e4fb64c1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -246,6 +246,7 @@ config PPC
 	select HAVE_EFFICIENT_UNALIGNED_ACCESS
 	select HAVE_GUP_FAST
 	select HAVE_FTRACE_GRAPH_FUNC
+	select HAVE_FTRACE_REGS_HAVING_PT_REGS
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_FUNCTION_ARG_ACCESS_API
 	select HAVE_FUNCTION_DESCRIPTORS	if PPC64_ELF_ABI_V1
diff --git a/arch/powerpc/include/asm/fprobe.h b/arch/powerpc/include/asm/fprobe.h
new file mode 100644
index 000000000000..d64bc28fb3d3
--- /dev/null
+++ b/arch/powerpc/include/asm/fprobe.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_PPC_FPROBE_H
+#define _ASM_PPC_FPROBE_H
+
+#include <asm-generic/fprobe.h>
+
+#ifdef CONFIG_64BIT
+#undef FPROBE_HEADER_MSB_PATTERN
+#define FPROBE_HEADER_MSB_PATTERN	(PAGE_OFFSET & ~FPROBE_HEADER_MSB_MASK)
+#endif
+
+#endif /* _ASM_PPC_FPROBE_H */
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer
@ 2025-07-23  5:28 Venkat
  0 siblings, 0 replies; 4+ messages in thread
From: Venkat @ 2025-07-23  5:28 UTC (permalink / raw)
  To: adityab1
  Cc: christophe.leroy, Hari Bathini, LKML, linux-trace-kernel,
	linuxppc-dev, maddy, mark.rutland, mhiramat, Michael Ellerman,
	npiggin, rostedt, venkat88


Tested this patch by applying on top of mainline. Build and boot is successful. Also ran ftrace selftest, intended test passed and no new failures/errors introduced with this patch. Hence,

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

Regards,
Venkat.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer
  2025-07-22  8:56 ` [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer Aditya Bodkhe
@ 2025-07-26 14:15   ` Hari Bathini
  2025-08-04  7:12   ` Venkat
  1 sibling, 0 replies; 4+ messages in thread
From: Hari Bathini @ 2025-07-26 14:15 UTC (permalink / raw)
  To: Aditya Bodkhe, linuxppc-dev
  Cc: linux-kernel, linux-trace-kernel, maddy, mpe, npiggin,
	christophe.leroy, rostedt, mhiramat, mark.rutland, venkat88



On 22/07/25 2:26 pm, Aditya Bodkhe wrote:
> From: Hari Bathini <hbathini@linux.ibm.com>
> 
> Since commit 4346ba160409 ("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 b5fa903b7f7c ("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 762abbc0d09f ("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().
> 

Aditya, I assume there is no change on this patch from v1. I see
you missed the Acked-by tag from Masami while sending v2 though:

https://lore.kernel.org/all/20250609164700.d8afe4ac1b4dea195bb7e379@kernel.org/ 


> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> Signed-off-by: Aditya Bodkhe <adityab1@linux.ibm.com>
> ---
>   arch/powerpc/Kconfig              |  1 +
>   arch/powerpc/include/asm/fprobe.h | 12 ++++++++++++
>   2 files changed, 13 insertions(+)
>   create mode 100644 arch/powerpc/include/asm/fprobe.h
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 9163521bc4b9..2203e4fb64c1 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -246,6 +246,7 @@ config PPC
>   	select HAVE_EFFICIENT_UNALIGNED_ACCESS
>   	select HAVE_GUP_FAST
>   	select HAVE_FTRACE_GRAPH_FUNC
> +	select HAVE_FTRACE_REGS_HAVING_PT_REGS
>   	select HAVE_FTRACE_MCOUNT_RECORD
>   	select HAVE_FUNCTION_ARG_ACCESS_API
>   	select HAVE_FUNCTION_DESCRIPTORS	if PPC64_ELF_ABI_V1
> diff --git a/arch/powerpc/include/asm/fprobe.h b/arch/powerpc/include/asm/fprobe.h
> new file mode 100644
> index 000000000000..d64bc28fb3d3
> --- /dev/null
> +++ b/arch/powerpc/include/asm/fprobe.h
> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_PPC_FPROBE_H
> +#define _ASM_PPC_FPROBE_H
> +
> +#include <asm-generic/fprobe.h>
> +
> +#ifdef CONFIG_64BIT
> +#undef FPROBE_HEADER_MSB_PATTERN
> +#define FPROBE_HEADER_MSB_PATTERN	(PAGE_OFFSET & ~FPROBE_HEADER_MSB_MASK)
> +#endif
> +
> +#endif /* _ASM_PPC_FPROBE_H */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer
  2025-07-22  8:56 ` [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer Aditya Bodkhe
  2025-07-26 14:15   ` Hari Bathini
@ 2025-08-04  7:12   ` Venkat
  1 sibling, 0 replies; 4+ messages in thread
From: Venkat @ 2025-08-04  7:12 UTC (permalink / raw)
  To: Aditya Bodkhe
  Cc: linuxppc-dev, LKML, linux-trace-kernel, maddy, Michael Ellerman,
	npiggin, christophe.leroy, rostedt, mhiramat, mark.rutland,
	Hari Bathini



> On 22 Jul 2025, at 2:26 PM, Aditya Bodkhe <adityab1@linux.ibm.com> wrote:
> 
> From: Hari Bathini <hbathini@linux.ibm.com>
> 
> Since commit 4346ba160409 ("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 b5fa903b7f7c ("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 762abbc0d09f ("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().
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> Signed-off-by: Aditya Bodkhe <adityab1@linux.ibm.com>
> ---
> arch/powerpc/Kconfig              |  1 +
> arch/powerpc/include/asm/fprobe.h | 12 ++++++++++++
> 2 files changed, 13 insertions(+)
> create mode 100644 arch/powerpc/include/asm/fprobe.h
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 9163521bc4b9..2203e4fb64c1 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -246,6 +246,7 @@ config PPC
> select HAVE_EFFICIENT_UNALIGNED_ACCESS
> select HAVE_GUP_FAST
> select HAVE_FTRACE_GRAPH_FUNC
> + select HAVE_FTRACE_REGS_HAVING_PT_REGS
> select HAVE_FTRACE_MCOUNT_RECORD
> select HAVE_FUNCTION_ARG_ACCESS_API
> select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
> diff --git a/arch/powerpc/include/asm/fprobe.h b/arch/powerpc/include/asm/fprobe.h
> new file mode 100644
> index 000000000000..d64bc28fb3d3
> --- /dev/null
> +++ b/arch/powerpc/include/asm/fprobe.h
> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_PPC_FPROBE_H
> +#define _ASM_PPC_FPROBE_H
> +
> +#include <asm-generic/fprobe.h>
> +
> +#ifdef CONFIG_64BIT
> +#undef FPROBE_HEADER_MSB_PATTERN
> +#define FPROBE_HEADER_MSB_PATTERN (PAGE_OFFSET & ~FPROBE_HEADER_MSB_MASK)
> +#endif
> +
> +#endif /* _ASM_PPC_FPROBE_H */
> -- 
> 2.50.0
> 

<Resending to the right thread>

Tested this patch by applying on top of mainline. Build and boot is successful. Also ran ftrace selftest, intended test passed and no new failures/errors introduced with this patch. Hence,

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

Regards,
Venkat.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-04  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23  5:28 [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer Venkat
  -- strict thread matches above, loose matches on Subject: below --
2025-07-22  8:56 [PATCH v2 1/2] powerpc/ftrace: support CONFIG_FUNCTION_GRAPH_RETVAL Aditya Bodkhe
2025-07-22  8:56 ` [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer Aditya Bodkhe
2025-07-26 14:15   ` Hari Bathini
2025-08-04  7:12   ` Venkat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).