Skip to content

Commit 45fe439

Browse files
committed
fgraph: Add comment to describe ftrace_graph_get_ret_stack
The ret_stack should not be accessed directly via the curr_ret_stack variable on the task_struct. This is because the ret_stack is going to be converted into a series of longs and not an array of ret_stack structures. The way that a ret_stack should be retrieved is via the ftrace_graph_get_ret_stack structure, but it needs to be documented on how to use it. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent e4c07bf commit 45fe439

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎kernel/trace/fgraph.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
232232
return ret;
233233
}
234234

235+
/**
236+
* ftrace_graph_get_ret_stack - return the entry of the shadow stack
237+
* @task: The task to read the shadow stack from
238+
* @idx: Index down the shadow stack
239+
*
240+
* Return the ret_struct on the shadow stack of the @task at the
241+
* call graph at @idx starting with zero. If @idx is zero, it
242+
* will return the last saved ret_stack entry. If it is greater than
243+
* zero, it will return the corresponding ret_stack for the depth
244+
* of saved return addresses.
245+
*/
235246
struct ftrace_ret_stack *
236247
ftrace_graph_get_ret_stack(struct task_struct *task, int idx)
237248
{

0 commit comments

Comments
 (0)