From: Peter Zijlstra <peterz@infradead.org>
To: Donglin Peng <pengdonglin@sangfor.com.cn>
Cc: mhiramat@kernel.org, rostedt@goodmis.org, linux@armlinux.org.uk,
mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com,
palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de,
dave.hansen@linux.intel.com, x86@kernel.org, mingo@redhat.com,
xiehuan09@gmail.com, dinghui@sangfor.com.cn,
huangcun@sangfor.com.cn, dolinux.peng@gmail.com,
linux-trace-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] function_graph: Support recording and printing the return value of function
Date: Wed, 15 Mar 2023 14:49:11 +0100 [thread overview]
Message-ID: <20230315134911.GD2006103@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230315133911.958741-2-pengdonglin@sangfor.com.cn>
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) ?
next prev parent reply other threads:[~2023-03-15 13:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 13:39 [PATCH v4 0/2] function_graph: Support recording and printing the return value of function Donglin Peng
2023-03-15 13:39 ` [PATCH v4 1/2] " Donglin Peng
2023-03-15 13:49 ` Peter Zijlstra [this message]
2023-03-15 14:13 ` Steven Rostedt
2023-03-15 14:57 ` Peter Zijlstra
2023-03-16 3:18 ` Donglin Peng
2023-03-16 12:39 ` Masami Hiramatsu
2023-03-16 13:13 ` Donglin Peng
2023-03-16 23:21 ` Russell King (Oracle)
2023-03-17 2:49 ` Donglin Peng
2023-03-18 16:40 ` Steven Rostedt
2023-03-19 4:14 ` Donglin Peng
2023-03-15 13:39 ` [PATCH v4 2/2] tracing: Add documentation for funcgraph-retval and graph_retval_hex Donglin Peng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230315134911.GD2006103@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=dinghui@sangfor.com.cn \
--cc=dolinux.peng@gmail.com \
--cc=huangcun@sangfor.com.cn \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pengdonglin@sangfor.com.cn \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=xiehuan09@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).