]> git.baikalelectronics.ru Git - kernel.git/commit
riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support
authorAlan Kao <alankao@andestech.com>
Tue, 13 Feb 2018 05:13:21 +0000 (13:13 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 3 Apr 2018 02:59:13 +0000 (19:59 -0700)
commita674891a3cb06a606220f96488fba7645d8186a2
treef62b6429a1853e0d9627733a2f9ea7b4baeed937
parent52e7910f3656f76e1e78f569bca72eb2110ff149
riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support

In walk_stackframe, the pc now receives the address from calling
ftrace_graph_ret_addr instead of manual calculation.

Note that the original calculation,
        pc = frame->ra - 4
is buggy when the instruction at the return address happened to be a
compressed inst. But since it is not a critical part of ftrace, it is
ignored for now to ease the review process.

Cc: Greentime Hu <greentime@andestech.com>
Signed-off-by: Alan Kao <alankao@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/ftrace.c
arch/riscv/kernel/stacktrace.c