@@ -299,7 +299,8 @@ static int entry_run(struct ftrace_graph_ent *trace, struct fgraph_ops *ops,
299299}
300300
301301/* ftrace_graph_return set to this to tell some archs to run function graph */
302- static void return_run (struct ftrace_graph_ret * trace , struct fgraph_ops * ops )
302+ static void return_run (struct ftrace_graph_ret * trace , struct fgraph_ops * ops ,
303+ struct ftrace_regs * fregs )
303304{
304305}
305306
@@ -528,7 +529,8 @@ int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace,
528529}
529530
530531static void ftrace_graph_ret_stub (struct ftrace_graph_ret * trace ,
531- struct fgraph_ops * gops )
532+ struct fgraph_ops * gops ,
533+ struct ftrace_regs * fregs )
532534{
533535}
534536
@@ -825,6 +827,9 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe
825827 }
826828
827829 trace .rettime = trace_clock_local ();
830+ if (fregs )
831+ ftrace_regs_set_instruction_pointer (fregs , ret );
832+
828833#ifdef CONFIG_FUNCTION_GRAPH_RETVAL
829834 trace .retval = ftrace_regs_get_return_value (fregs );
830835#endif
@@ -834,7 +839,7 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe
834839#ifdef CONFIG_HAVE_STATIC_CALL
835840 if (static_branch_likely (& fgraph_do_direct )) {
836841 if (test_bit (fgraph_direct_gops -> idx , & bitmap ))
837- static_call (fgraph_retfunc )(& trace , fgraph_direct_gops );
842+ static_call (fgraph_retfunc )(& trace , fgraph_direct_gops , fregs );
838843 } else
839844#endif
840845 {
@@ -844,7 +849,7 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe
844849 if (gops == & fgraph_stub )
845850 continue ;
846851
847- gops -> retfunc (& trace , gops );
852+ gops -> retfunc (& trace , gops , fregs );
848853 }
849854 }
850855
@@ -1016,7 +1021,8 @@ void ftrace_graph_sleep_time_control(bool enable)
10161021 * Simply points to ftrace_stub, but with the proper protocol.
10171022 * Defined by the linker script in linux/vmlinux.lds.h
10181023 */
1019- void ftrace_stub_graph (struct ftrace_graph_ret * trace , struct fgraph_ops * gops );
1024+ void ftrace_stub_graph (struct ftrace_graph_ret * trace , struct fgraph_ops * gops ,
1025+ struct ftrace_regs * fregs );
10201026
10211027/* The callbacks that hook a function */
10221028trace_func_graph_ret_t ftrace_graph_return = ftrace_stub_graph ;
0 commit comments