ftrace.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <asm/insn.h>
  14. #define MCOUNT_ADDR ((unsigned long)_mcount)
  15. #define MCOUNT_INSN_SIZE AARCH64_INSN_SIZE
  16. #ifndef __ASSEMBLY__
  17. #include <linux/compat.h>
  18. extern void _mcount(unsigned long);
  19. extern void *return_address(unsigned int);
  20. struct dyn_arch_ftrace {
  21. /* No extra data needed for arm64 */
  22. };
  23. extern unsigned long ftrace_graph_call;
  24. static inline unsigned long ftrace_call_adjust(unsigned long addr)
  25. {
  26. /*
  27. * addr is the address of the mcount call instruction.
  28. * recordmcount does the necessary offset calculation.
  29. */
  30. return addr;
  31. }
  32. #define ftrace_return_address(n) return_address(n)
  33. /*
  34. * Because AArch32 mode does not share the same syscall table with AArch64,
  35. * tracing compat syscalls may result in reporting bogus syscalls or even
  36. * hang-up, so just do not trace them.
  37. * See kernel/trace/trace_syscalls.c
  38. *
  39. * x86 code says:
  40. * If the user realy wants these, then they should use the
  41. * raw syscall tracepoints with filtering.
  42. */
  43. #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
  44. static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
  45. {
  46. return is_compat_task();
  47. }
  48. #endif /* ifndef __ASSEMBLY__ */
  49. #endif /* __ASM_FTRACE_H */