AKASHI Takahiro | 819e50e | 2014-04-30 18:54:33 +0900 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm64/include/asm/ftrace.h |
| 3 | * |
| 4 | * Copyright (C) 2013 Linaro Limited |
| 5 | * Author: AKASHI Takahiro <takahiro.akashi@linaro.org> |
| 6 | * |
| 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. |
| 10 | */ |
| 11 | #ifndef __ASM_FTRACE_H |
| 12 | #define __ASM_FTRACE_H |
| 13 | |
| 14 | #include <asm/insn.h> |
| 15 | |
| 16 | #define MCOUNT_ADDR ((unsigned long)_mcount) |
| 17 | #define MCOUNT_INSN_SIZE AARCH64_INSN_SIZE |
| 18 | |
| 19 | #ifndef __ASSEMBLY__ |
AKASHI Takahiro | 055b121 | 2014-04-30 10:54:36 +0100 | [diff] [blame] | 20 | #include <linux/compat.h> |
| 21 | |
AKASHI Takahiro | 819e50e | 2014-04-30 18:54:33 +0900 | [diff] [blame] | 22 | extern void _mcount(unsigned long); |
AKASHI Takahiro | 3711784 | 2014-04-30 10:54:35 +0100 | [diff] [blame] | 23 | extern void *return_address(unsigned int); |
AKASHI Takahiro | bd7d38d | 2014-04-30 10:54:34 +0100 | [diff] [blame] | 24 | |
| 25 | struct dyn_arch_ftrace { |
| 26 | /* No extra data needed for arm64 */ |
| 27 | }; |
| 28 | |
| 29 | extern unsigned long ftrace_graph_call; |
| 30 | |
| 31 | static inline unsigned long ftrace_call_adjust(unsigned long addr) |
| 32 | { |
| 33 | /* |
| 34 | * addr is the address of the mcount call instruction. |
| 35 | * recordmcount does the necessary offset calculation. |
| 36 | */ |
| 37 | return addr; |
| 38 | } |
AKASHI Takahiro | 3711784 | 2014-04-30 10:54:35 +0100 | [diff] [blame] | 39 | |
| 40 | #define ftrace_return_address(n) return_address(n) |
AKASHI Takahiro | 055b121 | 2014-04-30 10:54:36 +0100 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | * Because AArch32 mode does not share the same syscall table with AArch64, |
| 44 | * tracing compat syscalls may result in reporting bogus syscalls or even |
| 45 | * hang-up, so just do not trace them. |
| 46 | * See kernel/trace/trace_syscalls.c |
| 47 | * |
| 48 | * x86 code says: |
| 49 | * If the user realy wants these, then they should use the |
| 50 | * raw syscall tracepoints with filtering. |
| 51 | */ |
| 52 | #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS |
| 53 | static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) |
| 54 | { |
| 55 | return is_compat_task(); |
| 56 | } |
AKASHI Takahiro | 3711784 | 2014-04-30 10:54:35 +0100 | [diff] [blame] | 57 | #endif /* ifndef __ASSEMBLY__ */ |
AKASHI Takahiro | 819e50e | 2014-04-30 18:54:33 +0900 | [diff] [blame] | 58 | |
| 59 | #endif /* __ASM_FTRACE_H */ |