ftrace.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _ASM_ARM_FTRACE
  2. #define _ASM_ARM_FTRACE
  3. #ifdef CONFIG_FUNCTION_TRACER
  4. #define MCOUNT_ADDR ((long)(mcount))
  5. #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
  6. #ifndef __ASSEMBLY__
  7. extern void mcount(void);
  8. extern void __gnu_mcount_nc(void);
  9. #endif
  10. #endif
  11. #ifndef __ASSEMBLY__
  12. #if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
  13. /*
  14. * return_address uses walk_stackframe to do it's work. If both
  15. * CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=y walk_stackframe uses unwind
  16. * information. For this to work in the function tracer many functions would
  17. * have to be marked with __notrace. So for now just depend on
  18. * !CONFIG_ARM_UNWIND.
  19. */
  20. void *return_address(unsigned int);
  21. #else
  22. extern inline void *return_address(unsigned int level)
  23. {
  24. return NULL;
  25. }
  26. #endif
  27. #define HAVE_ARCH_CALLER_ADDR
  28. #define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
  29. #define CALLER_ADDR1 ((unsigned long)return_address(1))
  30. #define CALLER_ADDR2 ((unsigned long)return_address(2))
  31. #define CALLER_ADDR3 ((unsigned long)return_address(3))
  32. #define CALLER_ADDR4 ((unsigned long)return_address(4))
  33. #define CALLER_ADDR5 ((unsigned long)return_address(5))
  34. #define CALLER_ADDR6 ((unsigned long)return_address(6))
  35. #endif /* ifndef __ASSEMBLY__ */
  36. #endif /* _ASM_ARM_FTRACE */