Skip to content

Commit

Permalink
ftrace: fix hardirq header for non ftrace archs
Browse files Browse the repository at this point in the history
Impact: build fix for non-ftrace architectures

Not all archs implement ftrace, and therefore do not have an asm/ftrace.h.
This patch corrects the problem.

The ftrace_nmi_enter/exit now must be defined for all archs that implement
dynamic ftrace. Currently, only x86 does.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 3, 2008
1 parent 7a895f5 commit 7e5e26a
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 38 deletions.
5 changes: 0 additions & 5 deletions arch/arm/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_ARM_FTRACE
#define _ASM_ARM_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_ADDR ((long)(mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_POWERPC_FTRACE
#define _ASM_POWERPC_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_ADDR ((long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
5 changes: 0 additions & 5 deletions arch/sh/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifndef __ASSEMBLY__
extern void mcount(void);
#endif
Expand Down
5 changes: 0 additions & 5 deletions arch/sparc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef _ASM_SPARC64_FTRACE
#define _ASM_SPARC64_FTRACE

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#ifdef CONFIG_MCOUNT
#define MCOUNT_ADDR ((long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
Expand Down
16 changes: 0 additions & 16 deletions arch/x86/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
*/
return addr - 1;
}

#ifdef CONFIG_DYNAMIC_FTRACE
extern void ftrace_nmi_enter(void);
extern void ftrace_nmi_exit(void);
#else
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif
#endif /* __ASSEMBLY__ */

#else /* CONFIG_FUNCTION_TRACER */

#ifndef __ASSEMBLY__
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif

#endif /* CONFIG_FUNCTION_TRACER */

#endif /* _ASM_X86_FTRACE_H */
5 changes: 4 additions & 1 deletion include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static inline void ftrace_kill(void) { }
#endif /* CONFIG_FUNCTION_TRACER */

#ifdef CONFIG_DYNAMIC_FTRACE

enum {
FTRACE_FL_FREE = (1 << 0),
FTRACE_FL_FAILED = (1 << 1),
Expand Down Expand Up @@ -105,6 +104,8 @@ extern void ftrace_release(void *start, unsigned long size);

extern void ftrace_disable_daemon(void);
extern void ftrace_enable_daemon(void);
extern void ftrace_nmi_enter(void);
extern void ftrace_nmi_exit(void);

#else
# define skip_trace(ip) ({ 0; })
Expand All @@ -113,6 +114,8 @@ extern void ftrace_enable_daemon(void);
# define ftrace_disable_daemon() do { } while (0)
# define ftrace_enable_daemon() do { } while (0)
static inline void ftrace_release(void *start, unsigned long size) { }
static inline void ftrace_nmi_enter(void) { }
static inline void ftrace_nmi_exit(void) { }
#endif /* CONFIG_DYNAMIC_FTRACE */

/* totally disable ftrace - can not re-enable after this */
Expand Down
2 changes: 1 addition & 1 deletion include/linux/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <linux/preempt.h>
#include <linux/smp_lock.h>
#include <linux/lockdep.h>
#include <linux/ftrace.h>
#include <asm/hardirq.h>
#include <asm/ftrace.h>
#include <asm/system.h>

/*
Expand Down

0 comments on commit 7e5e26a

Please sign in to comment.