Re: [PATCH v14 05/19] function_graph: Pass ftrace_regs to retfunc

From
Steven Rostedt <rostedt@goodmis.org>
Date
2024-09-30 19:02:17
Also in
linux-arm-kernel, lkml
Reply to
Will Deacon, 2024-09-17
On Tue, 17 Sep 2024 11:08:48 +0100
Will Deacon [off-list ref] wrote:
quoted
quoted
@@ -787,6 +789,9 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe
 	}
 
 	trace.rettime = trace_clock_local();
+	if (fregs)
+		ftrace_regs_set_instruction_pointer(fregs, ret);  
Where does the instruction pointer get used after this? The arm64
'return_to_handler' function doesn't look at it when we return.
It's for the hooks to the return instruction. kretprobes will start using
function graph tracer to hook to a return of a function (via fprobes), and
the callbacks will need access to the return pointer. The callbacks get
passed the ftrace_regs, and this is how they can see what the function is
returning to. For example, BPF programs will need this.

So it's not needed for the infrastructure, only the callbacks that hook to
it.

-- Steve
Thread (53 messages) 53 messages, 4 authors, last reply 2024-10-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help