diff options
author | Zong Li <zong@andestech.com> | 2018-08-15 11:05:40 +0800 |
---|---|---|
committer | Greentime Hu <greentime@andestech.com> | 2018-09-04 14:45:18 +0800 |
commit | 1e377ae9b04aef4dc531fa4c5f81b65d440ebcba (patch) | |
tree | 4a43286c98a7ba45a865f7a75364d651f1e9d65e /arch/nds32/kernel/stacktrace.c | |
parent | 95cd2f7bce9aa712473bba1b5b3f4fdec148baee (diff) | |
download | talos-op-linux-1e377ae9b04aef4dc531fa4c5f81b65d440ebcba.tar.gz talos-op-linux-1e377ae9b04aef4dc531fa4c5f81b65d440ebcba.zip |
nds32/stack: Get real return address by using ftrace_graph_ret_addr
Function graph tracer has modified the return address to
'return_to_handler' on stack, and provide the 'ftrace_graph_ret_addr' to
get the real return address.
Signed-off-by: Zong Li <zong@andestech.com>
Acked-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/kernel/stacktrace.c')
-rw-r--r-- | arch/nds32/kernel/stacktrace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/nds32/kernel/stacktrace.c b/arch/nds32/kernel/stacktrace.c index 8b231e910ea6..36bc87003e83 100644 --- a/arch/nds32/kernel/stacktrace.c +++ b/arch/nds32/kernel/stacktrace.c @@ -4,6 +4,7 @@ #include <linux/sched/debug.h> #include <linux/sched/task_stack.h> #include <linux/stacktrace.h> +#include <linux/ftrace.h> void save_stack_trace(struct stack_trace *trace) { @@ -16,6 +17,7 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) unsigned long *fpn; int skip = trace->skip; int savesched; + int graph_idx = 0; if (tsk == current) { __asm__ __volatile__("\tori\t%0, $fp, #0\n":"=r"(fpn)); @@ -33,6 +35,8 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) fpp = fpn[FP_OFFSET]; if (!__kernel_text_address(lpp)) break; + else + lpp = ftrace_graph_ret_addr(tsk, &graph_idx, lpp, NULL); if (savesched || !in_sched_functions(lpp)) { if (skip) { |