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 #define MCOUNT_ADDR ((long)(mcount))
39 #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
41 #ifdef CONFIG_DYNAMIC_FTRACE
42 #define ARCH_SUPPORTS_FTRACE_OPS 1
43 #define ARCH_SUPPORTS_FTRACE_SAVE_REGS
47 extern void mcount(void);
48 extern atomic_t modifying_ftrace_code;
50 static inline unsigned long ftrace_call_adjust(unsigned long addr)
53 * addr is the address of the mcount call instruction.
54 * recordmcount does the necessary offset calculation.
59 #ifdef CONFIG_DYNAMIC_FTRACE
61 struct dyn_arch_ftrace {
62 /* No extra data needed for x86 */
65 int ftrace_int3_handler(struct pt_regs *regs);
67 #endif /* CONFIG_DYNAMIC_FTRACE */
68 #endif /* __ASSEMBLY__ */
69 #endif /* CONFIG_FUNCTION_TRACER */
71 #endif /* _ASM_X86_FTRACE_H */