diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-12-07 18:25:52 +0100 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-12-10 18:22:45 +0100 |
commit | 45fe439bc3699851802062c05acf4cbac4d672bc (patch) | |
tree | c8017bddbd42a2b0ec84e1cfcc3e4e13bcbcc98c /kernel | |
parent | arm64: ftrace: Set FTRACE_MAY_SLEEP before ftrace_modify_all_code() (diff) | |
download | linux-45fe439bc3699851802062c05acf4cbac4d672bc.tar.xz linux-45fe439bc3699851802062c05acf4cbac4d672bc.zip |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/fgraph.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index a3704ec8b599..d4f04f0ca646 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -232,6 +232,17 @@ unsigned long ftrace_return_to_handler(unsigned long frame_pointer) return ret; } +/** + * ftrace_graph_get_ret_stack - return the entry of the shadow stack + * @task: The task to read the shadow stack from + * @idx: Index down the shadow stack + * + * Return the ret_struct on the shadow stack of the @task at the + * call graph at @idx starting with zero. If @idx is zero, it + * will return the last saved ret_stack entry. If it is greater than + * zero, it will return the corresponding ret_stack for the depth + * of saved return addresses. + */ struct ftrace_ret_stack * ftrace_graph_get_ret_stack(struct task_struct *task, int idx) { |