2 * arch/arm64/include/asm/ftrace.h
4 * Copyright (C) 2013 Linaro Limited
5 * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #ifndef __ASM_FTRACE_H
12 #define __ASM_FTRACE_H
16 #define HAVE_FUNCTION_GRAPH_FP_TEST
17 #define MCOUNT_ADDR ((unsigned long)_mcount)
18 #define MCOUNT_INSN_SIZE AARCH64_INSN_SIZE
21 #include <linux/compat.h>
23 extern void _mcount(unsigned long);
24 extern void *return_address(unsigned int);
26 struct dyn_arch_ftrace {
27 /* No extra data needed for arm64 */
30 extern unsigned long ftrace_graph_call;
32 extern void return_to_handler(void);
34 static inline unsigned long ftrace_call_adjust(unsigned long addr)
37 * addr is the address of the mcount call instruction.
38 * recordmcount does the necessary offset calculation.
43 #define ftrace_return_address(n) return_address(n)
46 * Because AArch32 mode does not share the same syscall table with AArch64,
47 * tracing compat syscalls may result in reporting bogus syscalls or even
48 * hang-up, so just do not trace them.
49 * See kernel/trace/trace_syscalls.c
52 * If the user really wants these, then they should use the
53 * raw syscall tracepoints with filtering.
55 #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
56 static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
58 return is_compat_task();
61 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
63 static inline bool arch_syscall_match_sym_name(const char *sym,
67 * Since all syscall functions have __arm64_ prefix, we must skip it.
68 * However, as we described above, we decided to ignore compat
69 * syscalls, so we don't care about __arm64_compat_ prefix here.
71 return !strcmp(sym + 8, name);
73 #endif /* ifndef __ASSEMBLY__ */
75 #endif /* __ASM_FTRACE_H */