Re: [PATCH v19 12/19] fprobe: Rewrite fprobe on function-graph tracer
From: Heiko Carstens
Date: Sun Nov 10 2024 - 12:08:09 EST
On Mon, Nov 11, 2024 at 12:51:09AM +0900, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
>
> Rewrite fprobe implementation on function-graph tracer.
> Major API changes are:
> - 'nr_maxactive' field is deprecated.
> - This depends on CONFIG_DYNAMIC_FTRACE_WITH_ARGS or
> !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS, and
> CONFIG_HAVE_FUNCTION_GRAPH_FREGS. So currently works only
> on x86_64.
> - Currently the entry size is limited in 15 * sizeof(long).
> - If there is too many fprobe exit handler set on the same
> function, it will fail to probe.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> ---
> arch/arm64/include/asm/ftrace.h | 6
> arch/loongarch/include/asm/ftrace.h | 6
> arch/powerpc/include/asm/ftrace.h | 6
> arch/riscv/include/asm/ftrace.h | 5
> arch/s390/include/asm/ftrace.h | 6
> arch/x86/include/asm/ftrace.h | 6
> include/linux/fprobe.h | 58 ++-
> kernel/trace/Kconfig | 10 -
> kernel/trace/fprobe.c | 637 +++++++++++++++++++++++++----------
> lib/test_fprobe.c | 45 --
> 10 files changed, 539 insertions(+), 246 deletions(-)
...
> diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
> index fd3f0fe9f7b3..a3b73a4f626e 100644
> --- a/arch/s390/include/asm/ftrace.h
> +++ b/arch/s390/include/asm/ftrace.h
> @@ -77,6 +77,12 @@ ftrace_regs_get_frame_pointer(struct ftrace_regs *fregs)
> return ftrace_regs_get_stack_pointer(fregs);
> }
>
> +static __always_inline unsigned long
> +ftrace_regs_get_return_address(const struct ftrace_regs *fregs)
> +{
> + return arch_ftrace_regs(fregs)->regs.gprs[14];
> +}
> +
Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx> # s390