1 #ifndef _ASM_X86_FTRACE_H
2 #define _ASM_X86_FTRACE_H
4 #ifdef CONFIG_FUNCTION_TRACER
6 # define MCOUNT_ADDR ((unsigned long)(__fentry__))
8 # define MCOUNT_ADDR ((unsigned long)(mcount))
10 #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
12 #ifdef CONFIG_DYNAMIC_FTRACE
13 #define ARCH_SUPPORTS_FTRACE_OPS 1
17 extern void mcount(void);
18 extern atomic_t modifying_ftrace_code
;
19 extern void __fentry__(void);
21 static inline unsigned long ftrace_call_adjust(unsigned long addr
)
24 * addr is the address of the mcount call instruction.
25 * recordmcount does the necessary offset calculation.
30 #ifdef CONFIG_DYNAMIC_FTRACE
32 struct dyn_arch_ftrace
{
33 /* No extra data needed for x86 */
36 int ftrace_int3_handler(struct pt_regs
*regs
);
38 #define FTRACE_GRAPH_TRAMP_ADDR FTRACE_GRAPH_ADDR
40 #endif /* CONFIG_DYNAMIC_FTRACE */
41 #endif /* __ASSEMBLY__ */
42 #endif /* CONFIG_FUNCTION_TRACER */
45 #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
47 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
48 #include <asm/compat.h>
51 * Because ia32 syscalls do not map to x86_64 syscall numbers
52 * this screws up the trace output when tracing a ia32 task.
53 * Instead of reporting bogus syscalls, just do not trace them.
55 * If the user really wants these, then they should use the
56 * raw syscall tracepoints with filtering.
58 #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 1
59 static inline bool arch_trace_is_compat_syscall(struct pt_regs
*regs
)
61 if (in_compat_syscall())
65 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
66 #endif /* !__ASSEMBLY__ && !COMPILE_OFFSETS */
68 #endif /* _ASM_X86_FTRACE_H */