1 #ifndef _ASM_POWERPC_FTRACE
2 #define _ASM_POWERPC_FTRACE
6 #ifdef CONFIG_FUNCTION_TRACER
7 #define MCOUNT_ADDR ((unsigned long)(_mcount))
8 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
12 /* Based off of objdump optput from glibc */
14 #define MCOUNT_SAVE_FRAME \
30 #define MCOUNT_RESTORE_FRAME \
47 #else /* !__ASSEMBLY__ */
48 extern void _mcount(void);
50 #ifdef CONFIG_DYNAMIC_FTRACE
51 # define FTRACE_ADDR ((unsigned long)ftrace_caller)
52 # define FTRACE_REGS_ADDR FTRACE_ADDR
53 static inline unsigned long ftrace_call_adjust(unsigned long addr
)
55 /* reloction of mcount call site is the same as the address */
59 struct dyn_arch_ftrace
{
62 #endif /* CONFIG_DYNAMIC_FTRACE */
63 #endif /* __ASSEMBLY__ */
65 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
66 #define ARCH_SUPPORTS_FTRACE_OPS 1
70 #if defined(CONFIG_FTRACE_SYSCALLS) && !defined(__ASSEMBLY__)
71 #ifdef PPC64_ELF_ABI_v1
72 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
73 static inline bool arch_syscall_match_sym_name(const char *sym
, const char *name
)
76 * Compare the symbol name with the system call name. Skip the .sys or .SyS
77 * prefix from the symbol name and the sys prefix from the system call name and
78 * just match the rest. This is only needed on ppc64 since symbol names on
79 * 32bit do not start with a period so the generic function will work.
81 return !strcmp(sym
+ 4, name
+ 3);
84 #endif /* CONFIG_FTRACE_SYSCALLS && !__ASSEMBLY__ */
86 #endif /* _ASM_POWERPC_FTRACE */