Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh/ftrace: Move arch_ftrace_nmi_{enter,exit} into nmi exception

SuperH is the last remaining user of arch_ftrace_nmi_{enter,exit}(),
remove it from the generic code and into the SuperH code.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: https://lkml.kernel.org/r/20200505134101.248881738@linutronix.de


authored by

Peter Zijlstra and committed by
Thomas Gleixner
178ba00c e616cb8d

+12 -30
-8
Documentation/trace/ftrace-design.rst
··· 229 229 pass the return address pointer as the 'retp' argument to 230 230 ftrace_push_return_trace(). 231 231 232 - HAVE_FTRACE_NMI_ENTER 233 - --------------------- 234 - 235 - If you can't trace NMI functions, then skip this option. 236 - 237 - <details to be filled> 238 - 239 - 240 232 HAVE_SYSCALL_TRACEPOINTS 241 233 ------------------------ 242 234
-1
arch/sh/Kconfig
··· 71 71 select HAVE_FUNCTION_TRACER 72 72 select HAVE_FTRACE_MCOUNT_RECORD 73 73 select HAVE_DYNAMIC_FTRACE 74 - select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE 75 74 select ARCH_WANT_IPC_PARSE_VERSION 76 75 select HAVE_FUNCTION_GRAPH_TRACER 77 76 select HAVE_ARCH_KGDB
+12
arch/sh/kernel/traps.c
··· 170 170 force_sig(SIGTRAP); 171 171 } 172 172 173 + #ifdef CONFIG_DYNAMIC_FTRACE 174 + extern void arch_ftrace_nmi_enter(void); 175 + extern void arch_ftrace_nmi_exit(void); 176 + #else 177 + static inline void arch_ftrace_nmi_enter(void) { } 178 + static inline void arch_ftrace_nmi_exit(void) { } 179 + #endif 180 + 173 181 BUILD_TRAP_HANDLER(nmi) 174 182 { 175 183 unsigned int cpu = smp_processor_id(); 176 184 TRAP_HANDLER_DECL; 185 + 186 + arch_ftrace_nmi_enter(); 177 187 178 188 nmi_enter(); 179 189 nmi_count(cpu)++; ··· 200 190 } 201 191 202 192 nmi_exit(); 193 + 194 + arch_ftrace_nmi_exit(); 203 195 }
-11
include/linux/ftrace_irq.h
··· 2 2 #ifndef _LINUX_FTRACE_IRQ_H 3 3 #define _LINUX_FTRACE_IRQ_H 4 4 5 - 6 - #ifdef CONFIG_FTRACE_NMI_ENTER 7 - extern void arch_ftrace_nmi_enter(void); 8 - extern void arch_ftrace_nmi_exit(void); 9 - #else 10 - static inline void arch_ftrace_nmi_enter(void) { } 11 - static inline void arch_ftrace_nmi_exit(void) { } 12 - #endif 13 - 14 5 #ifdef CONFIG_HWLAT_TRACER 15 6 extern bool trace_hwlat_callback_enabled; 16 7 extern void trace_hwlat_callback(bool enter); ··· 13 22 if (trace_hwlat_callback_enabled) 14 23 trace_hwlat_callback(true); 15 24 #endif 16 - arch_ftrace_nmi_enter(); 17 25 } 18 26 19 27 static inline void ftrace_nmi_exit(void) 20 28 { 21 - arch_ftrace_nmi_exit(); 22 29 #ifdef CONFIG_HWLAT_TRACER 23 30 if (trace_hwlat_callback_enabled) 24 31 trace_hwlat_callback(false);
-10
kernel/trace/Kconfig
··· 10 10 config NOP_TRACER 11 11 bool 12 12 13 - config HAVE_FTRACE_NMI_ENTER 14 - bool 15 - help 16 - See Documentation/trace/ftrace-design.rst 17 - 18 13 config HAVE_FUNCTION_TRACER 19 14 bool 20 15 help ··· 66 71 bool 67 72 select TRACE_CLOCK 68 73 select IRQ_WORK 69 - 70 - config FTRACE_NMI_ENTER 71 - bool 72 - depends on HAVE_FTRACE_NMI_ENTER 73 - default y 74 74 75 75 config EVENT_TRACING 76 76 select CONTEXT_SWITCH_TRACER