ftrace.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __ASM_SH_FTRACE_H
  2. #define __ASM_SH_FTRACE_H
  3. #ifdef CONFIG_FUNCTION_TRACER
  4. #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
  5. #define FTRACE_SYSCALL_MAX NR_syscalls
  6. #ifndef __ASSEMBLY__
  7. extern void mcount(void);
  8. #define MCOUNT_ADDR ((unsigned long)(mcount))
  9. #ifdef CONFIG_DYNAMIC_FTRACE
  10. #define CALL_ADDR ((long)(ftrace_call))
  11. #define STUB_ADDR ((long)(ftrace_stub))
  12. #define GRAPH_ADDR ((long)(ftrace_graph_call))
  13. #define CALLER_ADDR ((long)(ftrace_caller))
  14. #define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4)
  15. #define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4)
  16. struct dyn_arch_ftrace {
  17. /* No extra data needed on sh */
  18. };
  19. #endif /* CONFIG_DYNAMIC_FTRACE */
  20. static inline unsigned long ftrace_call_adjust(unsigned long addr)
  21. {
  22. /* 'addr' is the memory table address. */
  23. return addr;
  24. }
  25. #endif /* __ASSEMBLY__ */
  26. #endif /* CONFIG_FUNCTION_TRACER */
  27. #ifndef __ASSEMBLY__
  28. /* arch/sh/kernel/return_address.c */
  29. extern void *return_address(unsigned int);
  30. #define ftrace_return_address(n) return_address(n)
  31. #endif /* __ASSEMBLY__ */
  32. #endif /* __ASM_SH_FTRACE_H */