b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _ASM_ARM_FTRACE |
| 3 | #define _ASM_ARM_FTRACE |
| 4 | |
| 5 | #define HAVE_FUNCTION_GRAPH_FP_TEST |
| 6 | |
| 7 | #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS |
| 8 | #define ARCH_SUPPORTS_FTRACE_OPS 1 |
| 9 | #endif |
| 10 | |
| 11 | #ifdef CONFIG_FUNCTION_TRACER |
| 12 | #define MCOUNT_ADDR ((unsigned long)(__gnu_mcount_nc)) |
| 13 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ |
| 14 | |
| 15 | #ifndef __ASSEMBLY__ |
| 16 | extern void mcount(void); |
| 17 | extern void __gnu_mcount_nc(void); |
| 18 | |
| 19 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 20 | struct dyn_arch_ftrace { |
| 21 | #ifdef CONFIG_ARM_MODULE_PLTS |
| 22 | struct module *mod; |
| 23 | #endif |
| 24 | }; |
| 25 | |
| 26 | static inline unsigned long ftrace_call_adjust(unsigned long addr) |
| 27 | { |
| 28 | /* With Thumb-2, the recorded addresses have the lsb set */ |
| 29 | return addr & ~1; |
| 30 | } |
| 31 | |
| 32 | extern void ftrace_caller_old(void); |
| 33 | extern void ftrace_call_old(void); |
| 34 | #endif |
| 35 | |
| 36 | #endif |
| 37 | |
| 38 | #endif |
| 39 | |
| 40 | #ifndef __ASSEMBLY__ |
| 41 | |
| 42 | void *return_address(unsigned int); |
| 43 | |
| 44 | #define ftrace_return_address(n) return_address(n) |
| 45 | |
| 46 | #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME |
| 47 | |
| 48 | static inline bool arch_syscall_match_sym_name(const char *sym, |
| 49 | const char *name) |
| 50 | { |
| 51 | if (!strcmp(sym, "sys_mmap2")) |
| 52 | sym = "sys_mmap_pgoff"; |
| 53 | else if (!strcmp(sym, "sys_statfs64_wrapper")) |
| 54 | sym = "sys_statfs64"; |
| 55 | else if (!strcmp(sym, "sys_fstatfs64_wrapper")) |
| 56 | sym = "sys_fstatfs64"; |
| 57 | else if (!strcmp(sym, "sys_arm_fadvise64_64")) |
| 58 | sym = "sys_fadvise64_64"; |
| 59 | |
| 60 | /* Ignore case since sym may start with "SyS" instead of "sys" */ |
| 61 | return !strcasecmp(sym, name); |
| 62 | } |
| 63 | |
| 64 | #endif /* ifndef __ASSEMBLY__ */ |
| 65 | |
| 66 | #endif /* _ASM_ARM_FTRACE */ |