]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1965aae3 PA |
2 | #ifndef _ASM_X86_FTRACE_H |
3 | #define _ASM_X86_FTRACE_H | |
395a59d0 | 4 | |
606576ce | 5 | #ifdef CONFIG_FUNCTION_TRACER |
d57c5d51 | 6 | #ifdef CC_USING_FENTRY |
c93bf928 | 7 | # define MCOUNT_ADDR ((unsigned long)(__fentry__)) |
d57c5d51 | 8 | #else |
c93bf928 | 9 | # define MCOUNT_ADDR ((unsigned long)(mcount)) |
e4a744ef | 10 | # define HAVE_FUNCTION_GRAPH_FP_TEST |
d57c5d51 | 11 | #endif |
395a59d0 AS |
12 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ |
13 | ||
28fb5dfa | 14 | #ifdef CONFIG_DYNAMIC_FTRACE |
2f5f6ad9 | 15 | #define ARCH_SUPPORTS_FTRACE_OPS 1 |
08f6fba5 | 16 | #endif |
2f5f6ad9 | 17 | |
471bd10f JP |
18 | #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR |
19 | ||
395a59d0 AS |
20 | #ifndef __ASSEMBLY__ |
21 | extern void mcount(void); | |
a192cd04 | 22 | extern atomic_t modifying_ftrace_code; |
d57c5d51 | 23 | extern void __fentry__(void); |
68bf21aa SR |
24 | |
25 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | |
26 | { | |
27 | /* | |
521ccb5c MS |
28 | * addr is the address of the mcount call instruction. |
29 | * recordmcount does the necessary offset calculation. | |
68bf21aa | 30 | */ |
521ccb5c | 31 | return addr; |
68bf21aa | 32 | } |
31e88909 SR |
33 | |
34 | #ifdef CONFIG_DYNAMIC_FTRACE | |
35 | ||
36 | struct dyn_arch_ftrace { | |
37 | /* No extra data needed for x86 */ | |
38 | }; | |
39 | ||
08d636b6 SR |
40 | int ftrace_int3_handler(struct pt_regs *regs); |
41 | ||
1026ff9b SRRH |
42 | #define FTRACE_GRAPH_TRAMP_ADDR FTRACE_GRAPH_ADDR |
43 | ||
31e88909 | 44 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
a26a2a27 | 45 | #endif /* __ASSEMBLY__ */ |
606576ce | 46 | #endif /* CONFIG_FUNCTION_TRACER */ |
395a59d0 | 47 | |
f431b634 SR |
48 | |
49 | #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS) | |
50 | ||
51 | #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION) | |
52 | #include <asm/compat.h> | |
53 | ||
54 | /* | |
55 | * Because ia32 syscalls do not map to x86_64 syscall numbers | |
56 | * this screws up the trace output when tracing a ia32 task. | |
57 | * Instead of reporting bogus syscalls, just do not trace them. | |
58 | * | |
6a6256f9 | 59 | * If the user really wants these, then they should use the |
f431b634 SR |
60 | * raw syscall tracepoints with filtering. |
61 | */ | |
62 | #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 1 | |
63 | static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) | |
64 | { | |
f970165b | 65 | if (in_compat_syscall()) |
f431b634 SR |
66 | return true; |
67 | return false; | |
68 | } | |
69 | #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */ | |
70 | #endif /* !__ASSEMBLY__ && !COMPILE_OFFSETS */ | |
71 | ||
1965aae3 | 72 | #endif /* _ASM_X86_FTRACE_H */ |