Skip to content

Commit

Permalink
sh/ftrace: Move arch_ftrace_nmi_{enter,exit} into nmi exception
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Zijlstra authored and Thomas Gleixner committed May 19, 2020
1 parent e616cb8 commit 178ba00
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 30 deletions.
8 changes: 0 additions & 8 deletions Documentation/trace/ftrace-design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,6 @@ Adding support for it is easy: just define the macro in asm/ftrace.h and
pass the return address pointer as the 'retp' argument to
ftrace_push_return_trace().

HAVE_FTRACE_NMI_ENTER
---------------------

If you can't trace NMI functions, then skip this option.

<details to be filled>


HAVE_SYSCALL_TRACEPOINTS
------------------------

Expand Down
1 change: 0 additions & 1 deletion arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ config SUPERH32
select HAVE_FUNCTION_TRACER
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
select ARCH_WANT_IPC_PARSE_VERSION
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_ARCH_KGDB
Expand Down
12 changes: 12 additions & 0 deletions arch/sh/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,21 @@ BUILD_TRAP_HANDLER(bug)
force_sig(SIGTRAP);
}

#ifdef CONFIG_DYNAMIC_FTRACE
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif

BUILD_TRAP_HANDLER(nmi)
{
unsigned int cpu = smp_processor_id();
TRAP_HANDLER_DECL;

arch_ftrace_nmi_enter();

nmi_enter();
nmi_count(cpu)++;

Expand All @@ -190,4 +200,6 @@ BUILD_TRAP_HANDLER(nmi)
}

nmi_exit();

arch_ftrace_nmi_exit();
}
11 changes: 0 additions & 11 deletions include/linux/ftrace_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
#ifndef _LINUX_FTRACE_IRQ_H
#define _LINUX_FTRACE_IRQ_H


#ifdef CONFIG_FTRACE_NMI_ENTER
extern void arch_ftrace_nmi_enter(void);
extern void arch_ftrace_nmi_exit(void);
#else
static inline void arch_ftrace_nmi_enter(void) { }
static inline void arch_ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_HWLAT_TRACER
extern bool trace_hwlat_callback_enabled;
extern void trace_hwlat_callback(bool enter);
Expand All @@ -22,12 +13,10 @@ static inline void ftrace_nmi_enter(void)
if (trace_hwlat_callback_enabled)
trace_hwlat_callback(true);
#endif
arch_ftrace_nmi_enter();
}

static inline void ftrace_nmi_exit(void)
{
arch_ftrace_nmi_exit();
#ifdef CONFIG_HWLAT_TRACER
if (trace_hwlat_callback_enabled)
trace_hwlat_callback(false);
Expand Down
10 changes: 0 additions & 10 deletions kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ config USER_STACKTRACE_SUPPORT
config NOP_TRACER
bool

config HAVE_FTRACE_NMI_ENTER
bool
help
See Documentation/trace/ftrace-design.rst

config HAVE_FUNCTION_TRACER
bool
help
Expand Down Expand Up @@ -72,11 +67,6 @@ config RING_BUFFER
select TRACE_CLOCK
select IRQ_WORK

config FTRACE_NMI_ENTER
bool
depends on HAVE_FTRACE_NMI_ENTER
default y

config EVENT_TRACING
select CONTEXT_SWITCH_TRACER
select GLOB
Expand Down

0 comments on commit 178ba00

Please sign in to comment.