blob: 4ec2c9b205f2138fb1239c9580da866b753ffbc4 [file] [log] [blame]
Steven Rostedt6a60dd12008-11-06 15:55:21 -05001#ifndef _LINUX_FTRACE_IRQ_H
2#define _LINUX_FTRACE_IRQ_H
3
4
Steven Rostedt78d904b2009-02-05 18:43:07 -05005#ifdef CONFIG_FTRACE_NMI_ENTER
Steven Rostedt (Red Hat)7b2c8622016-08-04 12:49:53 -04006extern void arch_ftrace_nmi_enter(void);
7extern void arch_ftrace_nmi_exit(void);
Steven Rostedt6a60dd12008-11-06 15:55:21 -05008#else
Steven Rostedt (Red Hat)7b2c8622016-08-04 12:49:53 -04009static inline void arch_ftrace_nmi_enter(void) { }
10static inline void arch_ftrace_nmi_exit(void) { }
Steven Rostedt6a60dd12008-11-06 15:55:21 -050011#endif
12
Steven Rostedt (Red Hat)7b2c8622016-08-04 12:49:53 -040013#ifdef CONFIG_HWLAT_TRACER
14extern bool trace_hwlat_callback_enabled;
15extern void trace_hwlat_callback(bool enter);
16#endif
17
18static inline void ftrace_nmi_enter(void)
19{
20#ifdef CONFIG_HWLAT_TRACER
21 if (trace_hwlat_callback_enabled)
22 trace_hwlat_callback(true);
23#endif
24 arch_ftrace_nmi_enter();
25}
26
27static inline void ftrace_nmi_exit(void)
28{
29 arch_ftrace_nmi_exit();
30#ifdef CONFIG_HWLAT_TRACER
31 if (trace_hwlat_callback_enabled)
32 trace_hwlat_callback(false);
33#endif
34}
35
Steven Rostedt6a60dd12008-11-06 15:55:21 -050036#endif /* _LINUX_FTRACE_IRQ_H */