History

nmi, tracing: Make hardware latency tracing noinstr safe

The hardware latency tracer calls into instrumentable functions. Move the calls into the RCU watching sections and annotate them.

Thomas Gleixner committed 6 years ago

Commit 2ab70311 parent 7102cb01 file · +6 −2Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/hardirq.h+6−2
@@ -87,20 +87,24 @@ extern void rcu_nmi_exit(void); · 86 unmodified lines
8787 arch_nmi_enter(); \
8888 printk_nmi_enter(); \
8989 lockdep_off(); \
90− ftrace_nmi_enter(); \
9190 BUG_ON(in_nmi() == NMI_MASK); \
9291 __preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
9392 rcu_nmi_enter(); \
9493 lockdep_hardirq_enter(); \
94+ instrumentation_begin(); \
95+ ftrace_nmi_enter(); \
96+ instrumentation_end(); \
9597 } while (0)
9698
9799 #define nmi_exit() \
98100 do { \
101+ instrumentation_begin(); \
102+ ftrace_nmi_exit(); \
103+ instrumentation_end(); \
99104 lockdep_hardirq_exit(); \
100105 rcu_nmi_exit(); \
101106 BUG_ON(!in_nmi()); \
102107 __preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \
103− ftrace_nmi_exit(); \
104108 lockdep_on(); \
105109 printk_nmi_exit(); \
106110 arch_nmi_exit(); \