1 #ifndef _ASM_X86_FTRACE_H
2 #define _ASM_X86_FTRACE_H
6 .macro MCOUNT_SAVE_FRAME
18 .macro MCOUNT_RESTORE_FRAME
31 #ifdef CONFIG_FUNCTION_TRACER
32 #define MCOUNT_ADDR ((long)(mcount))
33 #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
36 extern void mcount(void);
38 static inline unsigned long ftrace_call_adjust(unsigned long addr)
41 * call mcount is "e8 <4 byte offset>"
42 * The addr points to the 4 byte offset and the caller of this
43 * function wants the pointer to e8. Simply subtract one.
48 #ifdef CONFIG_DYNAMIC_FTRACE
50 struct dyn_arch_ftrace {
51 /* No extra data needed for x86 */
54 #endif /* CONFIG_DYNAMIC_FTRACE */
55 #endif /* __ASSEMBLY__ */
56 #endif /* CONFIG_FUNCTION_TRACER */
58 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
63 * Stack of return addresses for functions
65 * Used in struct thread_info
67 struct ftrace_ret_stack {
70 unsigned long long calltime;
74 * Primary handler of a function return.
75 * It relays on ftrace_return_to_handler.
76 * Defined in entry_32/64.S
78 extern void return_to_handler(void);
80 #endif /* __ASSEMBLY__ */
81 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
83 #endif /* _ASM_X86_FTRACE_H */