Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Steven Rostedt | 6a60dd1 | 2008-11-06 15:55:21 -0500 | [diff] [blame] | 2 | #ifndef _LINUX_FTRACE_IRQ_H |
| 3 | #define _LINUX_FTRACE_IRQ_H |
| 4 | |
| 5 | |
Steven Rostedt | 78d904b | 2009-02-05 18:43:07 -0500 | [diff] [blame] | 6 | #ifdef CONFIG_FTRACE_NMI_ENTER |
Steven Rostedt (Red Hat) | 7b2c862 | 2016-08-04 12:49:53 -0400 | [diff] [blame] | 7 | extern void arch_ftrace_nmi_enter(void); |
| 8 | extern void arch_ftrace_nmi_exit(void); |
Steven Rostedt | 6a60dd1 | 2008-11-06 15:55:21 -0500 | [diff] [blame] | 9 | #else |
Steven Rostedt (Red Hat) | 7b2c862 | 2016-08-04 12:49:53 -0400 | [diff] [blame] | 10 | static inline void arch_ftrace_nmi_enter(void) { } |
| 11 | static inline void arch_ftrace_nmi_exit(void) { } |
Steven Rostedt | 6a60dd1 | 2008-11-06 15:55:21 -0500 | [diff] [blame] | 12 | #endif |
| 13 | |
Steven Rostedt (Red Hat) | 7b2c862 | 2016-08-04 12:49:53 -0400 | [diff] [blame] | 14 | #ifdef CONFIG_HWLAT_TRACER |
| 15 | extern bool trace_hwlat_callback_enabled; |
| 16 | extern void trace_hwlat_callback(bool enter); |
| 17 | #endif |
| 18 | |
| 19 | static inline void ftrace_nmi_enter(void) |
| 20 | { |
| 21 | #ifdef CONFIG_HWLAT_TRACER |
| 22 | if (trace_hwlat_callback_enabled) |
| 23 | trace_hwlat_callback(true); |
| 24 | #endif |
| 25 | arch_ftrace_nmi_enter(); |
| 26 | } |
| 27 | |
| 28 | static inline void ftrace_nmi_exit(void) |
| 29 | { |
| 30 | arch_ftrace_nmi_exit(); |
| 31 | #ifdef CONFIG_HWLAT_TRACER |
| 32 | if (trace_hwlat_callback_enabled) |
| 33 | trace_hwlat_callback(false); |
| 34 | #endif |
| 35 | } |
| 36 | |
Steven Rostedt | 6a60dd1 | 2008-11-06 15:55:21 -0500 | [diff] [blame] | 37 | #endif /* _LINUX_FTRACE_IRQ_H */ |