Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support

Cc: Greentime Hu <greentime@andestech.com>
Signed-off-by: Alan Kao <alankao@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

authored by

Alan Kao and committed by
Palmer Dabbelt
71e736a7 bc1a4c3a

+4
+1
arch/riscv/include/asm/ftrace.h
··· 9 9 #define HAVE_FUNCTION_GRAPH_FP_TEST 10 10 #endif 11 11 12 + #define ARCH_SUPPORTS_FTRACE_OPS 1 12 13 #ifndef __ASSEMBLY__ 13 14 void _mcount(void); 14 15 static inline unsigned long ftrace_call_adjust(unsigned long addr)
+3
arch/riscv/kernel/mcount-dyn.S
··· 74 74 /* 75 75 * a0: the address in the caller when calling ftrace_caller 76 76 * a1: the caller's return address 77 + * a2: the address of global variable function_trace_op 77 78 */ 78 79 ld a1, -8(s0) 79 80 addi a0, ra, -MCOUNT_INSN_SIZE 81 + la t5, function_trace_op 82 + ld a2, 0(t5) 80 83 81 84 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 82 85 /*