[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230315134911.GD2006103@hirez.programming.kicks-ass.net>
Date: Wed, 15 Mar 2023 14:49:11 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Donglin Peng <pengdonglin@...gfor.com.cn>
Cc: mhiramat@...nel.org, rostedt@...dmis.org, linux@...linux.org.uk,
mark.rutland@....com, will@...nel.org, catalin.marinas@....com,
palmer@...belt.com, paul.walmsley@...ive.com, tglx@...utronix.de,
dave.hansen@...ux.intel.com, x86@...nel.org, mingo@...hat.com,
xiehuan09@...il.com, dinghui@...gfor.com.cn,
huangcun@...gfor.com.cn, dolinux.peng@...il.com,
linux-trace-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] function_graph: Support recording and printing
the return value of function
On Wed, Mar 15, 2023 at 06:39:10AM -0700, Donglin Peng wrote:
> diff --git a/arch/x86/kernel/ftrace_32.S b/arch/x86/kernel/ftrace_32.S
> index a0ed0e4a2c0c..44a773d9de82 100644
> --- a/arch/x86/kernel/ftrace_32.S
> +++ b/arch/x86/kernel/ftrace_32.S
> @@ -184,6 +184,10 @@ SYM_CODE_END(ftrace_graph_caller)
> return_to_handler:
> pushl %eax
> pushl %edx
> +#ifdef CONFIG_FUNCTION_GRAPH_RETVAL
> + /* Pass the function return value to ftrace_return_to_handler*/
> + movl %eax, %edx
> +#endif
> movl $0, %eax
> call ftrace_return_to_handler
> movl %eax, %ecx
> diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
> index 1265ad519249..35ac9c58dc77 100644
> --- a/arch/x86/kernel/ftrace_64.S
> +++ b/arch/x86/kernel/ftrace_64.S
> @@ -348,6 +348,10 @@ SYM_CODE_START(return_to_handler)
> movq %rax, (%rsp)
> movq %rdx, 8(%rsp)
> movq %rbp, %rdi
> +#ifdef CONFIG_FUNCTION_GRAPH_RETVAL
> + /* Pass the function return value to ftrace_return_to_handler */
> + movq %rax, %rsi
> +#endif
>
> call ftrace_return_to_handler
What about the case of double register return values (when the value
is returned in the A,D pair) ?
Powered by blists - more mailing lists