ftrace.h 559 B

123456789101112131415161718192021222324
  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
  18. #endif /* CONFIG_FUNCTION_TRACER */
  19. #endif /* _ASM_X86_FTRACE_H */