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
44 #define ARCH_SUPPORTS_FTRACE_SAVE_REGS
49 extern void mcount(void);
50 extern atomic_t modifying_ftrace_code;
52 static inline unsigned long ftrace_call_adjust(unsigned long addr)
55 * addr is the address of the mcount call instruction.
56 * recordmcount does the necessary offset calculation.
61 #ifdef CONFIG_DYNAMIC_FTRACE
63 struct dyn_arch_ftrace {
64 /* No extra data needed for x86 */
67 int ftrace_int3_handler(struct pt_regs *regs);
69 #endif /* CONFIG_DYNAMIC_FTRACE */
70 #endif /* __ASSEMBLY__ */
71 #endif /* CONFIG_FUNCTION_TRACER */
73 #endif /* _ASM_X86_FTRACE_H */