1 #ifndef _ASM_X86_FTRACE_H
2 #define _ASM_X86_FTRACE_H
6 /* skip is set if the stack was already partially adjusted */
7 .macro MCOUNT_SAVE_FRAME skip=0
9 * We add enough stack to save all regs.
11 subq $(SS+8-\skip), %rsp
19 /* Move RIP to its proper location */
24 .macro MCOUNT_RESTORE_FRAME skip=0
32 addq $(SS+8-\skip), %rsp
37 #ifdef CONFIG_FUNCTION_TRACER
38 #ifdef CC_USING_FENTRY
39 # define MCOUNT_ADDR ((long)(__fentry__))
41 # define MCOUNT_ADDR ((long)(mcount))
43 #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
45 #ifdef CONFIG_DYNAMIC_FTRACE
46 #define ARCH_SUPPORTS_FTRACE_OPS 1
47 #define ARCH_SUPPORTS_FTRACE_SAVE_REGS
51 extern void mcount(void);
52 extern atomic_t modifying_ftrace_code;
53 extern void __fentry__(void);
55 static inline unsigned long ftrace_call_adjust(unsigned long addr)
58 * addr is the address of the mcount call instruction.
59 * recordmcount does the necessary offset calculation.
64 #ifdef CONFIG_DYNAMIC_FTRACE
66 struct dyn_arch_ftrace {
67 /* No extra data needed for x86 */
70 int ftrace_int3_handler(struct pt_regs *regs);
72 #endif /* CONFIG_DYNAMIC_FTRACE */
73 #endif /* __ASSEMBLY__ */
74 #endif /* CONFIG_FUNCTION_TRACER */
76 #endif /* _ASM_X86_FTRACE_H */