ftrace_irq.h 884 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_FTRACE_IRQ_H
  3. #define _LINUX_FTRACE_IRQ_H
  4. #ifdef CONFIG_HWLAT_TRACER
  5. extern bool trace_hwlat_callback_enabled;
  6. extern void trace_hwlat_callback(bool enter);
  7. #endif
  8. #ifdef CONFIG_OSNOISE_TRACER
  9. extern bool trace_osnoise_callback_enabled;
  10. extern void trace_osnoise_callback(bool enter);
  11. #endif
  12. static inline void ftrace_nmi_enter(void)
  13. {
  14. #ifdef CONFIG_HWLAT_TRACER
  15. if (trace_hwlat_callback_enabled)
  16. trace_hwlat_callback(true);
  17. #endif
  18. #ifdef CONFIG_OSNOISE_TRACER
  19. if (trace_osnoise_callback_enabled)
  20. trace_osnoise_callback(true);
  21. #endif
  22. }
  23. static inline void ftrace_nmi_exit(void)
  24. {
  25. #ifdef CONFIG_HWLAT_TRACER
  26. if (trace_hwlat_callback_enabled)
  27. trace_hwlat_callback(false);
  28. #endif
  29. #ifdef CONFIG_OSNOISE_TRACER
  30. if (trace_osnoise_callback_enabled)
  31. trace_osnoise_callback(false);
  32. #endif
  33. }
  34. #endif /* _LINUX_FTRACE_IRQ_H */