Skip to content

Commit 178ba00

Browse files
Peter ZijlstraKAGA-KOKO
authored andcommitted
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) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Cc: Rich Felker <[email protected]> Cc: Yoshinori Sato <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e616cb8 commit 178ba00

File tree

5 files changed

+12
-30
lines changed

5 files changed

+12
-30
lines changed

Documentation/trace/ftrace-design.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ Adding support for it is easy: just define the macro in asm/ftrace.h and
229229
pass the return address pointer as the 'retp' argument to
230230
ftrace_push_return_trace().
231231

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-
240232
HAVE_SYSCALL_TRACEPOINTS
241233
------------------------
242234

arch/sh/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ config SUPERH32
7171
select HAVE_FUNCTION_TRACER
7272
select HAVE_FTRACE_MCOUNT_RECORD
7373
select HAVE_DYNAMIC_FTRACE
74-
select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
7574
select ARCH_WANT_IPC_PARSE_VERSION
7675
select HAVE_FUNCTION_GRAPH_TRACER
7776
select HAVE_ARCH_KGDB

arch/sh/kernel/traps.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,21 @@ BUILD_TRAP_HANDLER(bug)
170170
force_sig(SIGTRAP);
171171
}
172172

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+
173181
BUILD_TRAP_HANDLER(nmi)
174182
{
175183
unsigned int cpu = smp_processor_id();
176184
TRAP_HANDLER_DECL;
177185

186+
arch_ftrace_nmi_enter();
187+
178188
nmi_enter();
179189
nmi_count(cpu)++;
180190

@@ -190,4 +200,6 @@ BUILD_TRAP_HANDLER(nmi)
190200
}
191201

192202
nmi_exit();
203+
204+
arch_ftrace_nmi_exit();
193205
}

include/linux/ftrace_irq.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
#ifndef _LINUX_FTRACE_IRQ_H
33
#define _LINUX_FTRACE_IRQ_H
44

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-
145
#ifdef CONFIG_HWLAT_TRACER
156
extern bool trace_hwlat_callback_enabled;
167
extern void trace_hwlat_callback(bool enter);
@@ -22,12 +13,10 @@ static inline void ftrace_nmi_enter(void)
2213
if (trace_hwlat_callback_enabled)
2314
trace_hwlat_callback(true);
2415
#endif
25-
arch_ftrace_nmi_enter();
2616
}
2717

2818
static inline void ftrace_nmi_exit(void)
2919
{
30-
arch_ftrace_nmi_exit();
3120
#ifdef CONFIG_HWLAT_TRACER
3221
if (trace_hwlat_callback_enabled)
3322
trace_hwlat_callback(false);

kernel/trace/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ config USER_STACKTRACE_SUPPORT
1010
config NOP_TRACER
1111
bool
1212

13-
config HAVE_FTRACE_NMI_ENTER
14-
bool
15-
help
16-
See Documentation/trace/ftrace-design.rst
17-
1813
config HAVE_FUNCTION_TRACER
1914
bool
2015
help
@@ -72,11 +67,6 @@ config RING_BUFFER
7267
select TRACE_CLOCK
7368
select IRQ_WORK
7469

75-
config FTRACE_NMI_ENTER
76-
bool
77-
depends on HAVE_FTRACE_NMI_ENTER
78-
default y
79-
8070
config EVENT_TRACING
8171
select CONTEXT_SWITCH_TRACER
8272
select GLOB

0 commit comments

Comments
 (0)