riscv: ftrace: Make function graph use ftrace directly
authorSong Shuai <suagrfillet@gmail.com>
Thu, 30 Nov 2023 12:15:29 +0000 (13:15 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 18 Jan 2024 02:17:08 +0000 (18:17 -0800)
commit35e61e8827ee8ea09e6093ab4d8ba45efd537e36
tree909bd0b20f32458071763e5957f140c665b8ac5f
parentb546d6363af4791567dcd145109837fe97cc8ba5
riscv: ftrace: Make function graph use ftrace directly

Similar to commit 0c0593b45c9b ("x86/ftrace: Make function graph use
ftrace directly") and commit c4a0ebf87ceb ("arm64/ftrace: Make
function graph use ftrace directly"), RISC-V has no need for a special
graph tracer hook. The graph_ops::func function can be used to install
the return_hooker.

This cleanup only changes the FTRACE_WITH_REGS implementation, leaving
the mcount-based implementation is unaffected.

Perform the simplification, and also cleanup the register save/restore
macros.

Signed-off-by: Song Shuai <suagrfillet@gmail.com>
Tested-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Guo Ren <guoren@kernel.org>
Acked-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20231130121531.1178502-3-bjorn@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/ftrace.h
arch/riscv/kernel/ftrace.c
arch/riscv/kernel/mcount-dyn.S