ftrace.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _ASM_X86_FTRACE_H
  2. #define _ASM_X86_FTRACE_H
  3. #ifdef CONFIG_FUNCTION_TRACER
  4. #define MCOUNT_ADDR ((long)(mcount))
  5. #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
  6. #ifndef __ASSEMBLY__
  7. extern void mcount(void);
  8. static inline unsigned long ftrace_call_adjust(unsigned long addr)
  9. {
  10. /*
  11. * call mcount is "e8 <4 byte offset>"
  12. * The addr points to the 4 byte offset and the caller of this
  13. * function wants the pointer to e8. Simply subtract one.
  14. */
  15. return addr - 1;
  16. }
  17. #endif /* __ASSEMBLY__ */
  18. #endif /* CONFIG_FUNCTION_TRACER */
  19. #ifdef CONFIG_FUNCTION_RET_TRACER
  20. #define FTRACE_RET_STACK_SIZE 20
  21. #ifndef __ASSEMBLY__
  22. /*
  23. * Stack of return addresses for functions
  24. * of a thread.
  25. * Used in struct thread_info
  26. */
  27. struct ftrace_ret_stack {
  28. unsigned long ret;
  29. unsigned long func;
  30. unsigned long long calltime;
  31. };
  32. /*
  33. * Primary handler of a function return.
  34. * It relays on ftrace_return_to_handler.
  35. * Defined in entry32.S
  36. */
  37. extern void return_to_handler(void);
  38. #endif /* __ASSEMBLY__ */
  39. #endif /* CONFIG_FUNCTION_RET_TRACER */
  40. #endif /* _ASM_X86_FTRACE_H */