ftrace.h 1.1 KB

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