Thread (13 messages) 13 messages, 5 authors, 2023-03-19

Re: [PATCH v4 1/2] function_graph: Support recording and printing the return value of function

From: Peter Zijlstra <peterz@infradead.org>
Date: 2023-03-15 15:00:29
Also in: linux-arm-kernel, linux-riscv, lkml

On Wed, Mar 15, 2023 at 10:13:48AM -0400, Steven Rostedt wrote:
On Wed, 15 Mar 2023 14:49:11 +0100
Peter Zijlstra [off-list ref] wrote:
quoted
quoted
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) ?
Is there anything that does that in 64 bit kernels?
Note sure; but I have a patch series that introduces cmpxchg128 and
friends. Most of the actual functions are __always_inline, but still,
the moment a compiler decides to break out a subfunction on a u128
boundary we're in luck.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help