aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-22 03:08:14 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-22 03:08:14 -0400
commitdebfcaf93ed500a051489db6646d71f29fe86a68 (patch)
tree7ba189b6dd654022ecc655b68e3c0a4573627706
parent2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff)
parent81520a1b0649d0701205b818714a8c1e1cfbbb5b (diff)
Merge branch 'tracing/ftrace' into tracing/urgent
-rw-r--r--Makefile2
-rw-r--r--arch/arm/Kconfig4
-rw-r--r--arch/arm/boot/compressed/Makefile2
-rw-r--r--arch/arm/include/asm/ftrace.h2
-rw-r--r--arch/arm/kernel/armksyms.c2
-rw-r--r--arch/arm/kernel/entry-common.S4
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/powerpc/include/asm/ftrace.h2
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/entry_32.S2
-rw-r--r--arch/powerpc/kernel/entry_64.S2
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c2
-rw-r--r--arch/powerpc/platforms/powermac/Makefile2
-rw-r--r--arch/sparc64/Kconfig2
-rw-r--r--arch/sparc64/Kconfig.debug2
-rw-r--r--arch/sparc64/lib/mcount.S4
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/entry_32.S4
-rw-r--r--arch/x86/kernel/entry_64.S4
-rw-r--r--arch/x86/kernel/ftrace.c6
-rw-r--r--arch/x86/kernel/i386_ksyms_32.c2
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c2
-rw-r--r--arch/x86/xen/Makefile2
-rw-r--r--include/asm-x86/ftrace.h4
-rw-r--r--include/linux/ftrace.h12
-rw-r--r--kernel/Makefile4
-rw-r--r--kernel/sysctl.c2
-rw-r--r--kernel/trace/Kconfig22
-rw-r--r--kernel/trace/Makefile6
-rw-r--r--kernel/trace/ftrace.c43
-rw-r--r--kernel/trace/trace.c2
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--kernel/trace/trace_functions.c2
-rw-r--r--kernel/trace/trace_irqsoff.c4
-rw-r--r--kernel/trace/trace_sched_wakeup.c4
-rw-r--r--kernel/trace/trace_selftest.c4
-rw-r--r--kernel/trace/trace_stack.c4
-rw-r--r--lib/Makefile2
40 files changed, 113 insertions, 68 deletions
diff --git a/Makefile b/Makefile
index 16e3fbb968a8..b7eb70b13cad 100644
--- a/Makefile
+++ b/Makefile
@@ -536,7 +536,7 @@ KBUILD_CFLAGS += -g
536KBUILD_AFLAGS += -gdwarf-2 536KBUILD_AFLAGS += -gdwarf-2
537endif 537endif
538 538
539ifdef CONFIG_FTRACE 539ifdef CONFIG_FUNCTION_TRACER
540KBUILD_CFLAGS += -pg 540KBUILD_CFLAGS += -pg
541endif 541endif
542 542
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index df39d20f7425..600733426ae0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -16,8 +16,8 @@ config ARM
16 select HAVE_ARCH_KGDB 16 select HAVE_ARCH_KGDB
17 select HAVE_KPROBES if (!XIP_KERNEL) 17 select HAVE_KPROBES if (!XIP_KERNEL)
18 select HAVE_KRETPROBES if (HAVE_KPROBES) 18 select HAVE_KRETPROBES if (HAVE_KPROBES)
19 select HAVE_FTRACE if (!XIP_KERNEL) 19 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
20 select HAVE_DYNAMIC_FTRACE if (HAVE_FTRACE) 20 select HAVE_DYNAMIC_FTRACE if (HAVE_FUNCTION_TRACER)
21 select HAVE_GENERIC_DMA_COHERENT 21 select HAVE_GENERIC_DMA_COHERENT
22 help 22 help
23 The ARM series is a line of low-power-consumption RISC chip designs 23 The ARM series is a line of low-power-consumption RISC chip designs
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 7a03f2007882..c47f2a3f8f8f 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -70,7 +70,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
70targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ 70targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
71 head.o misc.o $(OBJS) 71 head.o misc.o $(OBJS)
72 72
73ifeq ($(CONFIG_FTRACE),y) 73ifeq ($(CONFIG_FUNCTION_TRACER),y)
74ORIG_CFLAGS := $(KBUILD_CFLAGS) 74ORIG_CFLAGS := $(KBUILD_CFLAGS)
75KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) 75KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
76endif 76endif
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index 584ef9a8e5a5..39c8bc1a006a 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_ARM_FTRACE 1#ifndef _ASM_ARM_FTRACE
2#define _ASM_ARM_FTRACE 2#define _ASM_ARM_FTRACE
3 3
4#ifdef CONFIG_FTRACE 4#ifdef CONFIG_FUNCTION_TRACER
5#define MCOUNT_ADDR ((long)(mcount)) 5#define MCOUNT_ADDR ((long)(mcount))
6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
7 7
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 2357b1cf1cf9..c74f766ffc12 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -183,6 +183,6 @@ EXPORT_SYMBOL(_find_next_bit_be);
183 183
184EXPORT_SYMBOL(copy_page); 184EXPORT_SYMBOL(copy_page);
185 185
186#ifdef CONFIG_FTRACE 186#ifdef CONFIG_FUNCTION_TRACER
187EXPORT_SYMBOL(mcount); 187EXPORT_SYMBOL(mcount);
188#endif 188#endif
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 3aa14dcc5bab..06269ea375c5 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -101,7 +101,7 @@ ENDPROC(ret_from_fork)
101#undef CALL 101#undef CALL
102#define CALL(x) .long x 102#define CALL(x) .long x
103 103
104#ifdef CONFIG_FTRACE 104#ifdef CONFIG_FUNCTION_TRACER
105#ifdef CONFIG_DYNAMIC_FTRACE 105#ifdef CONFIG_DYNAMIC_FTRACE
106ENTRY(mcount) 106ENTRY(mcount)
107 stmdb sp!, {r0-r3, lr} 107 stmdb sp!, {r0-r3, lr}
@@ -149,7 +149,7 @@ trace:
149ftrace_stub: 149ftrace_stub:
150 mov pc, lr 150 mov pc, lr
151 151
152#endif /* CONFIG_FTRACE */ 152#endif /* CONFIG_FUNCTION_TRACER */
153 153
154/*============================================================================= 154/*=============================================================================
155 * SWI handler 155 * SWI handler
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9391199d9e77..441ce06174ff 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -112,7 +112,7 @@ config PPC
112 bool 112 bool
113 default y 113 default y
114 select HAVE_DYNAMIC_FTRACE 114 select HAVE_DYNAMIC_FTRACE
115 select HAVE_FTRACE 115 select HAVE_FUNCTION_TRACER
116 select ARCH_WANT_OPTIONAL_GPIOLIB 116 select ARCH_WANT_OPTIONAL_GPIOLIB
117 select HAVE_IDE 117 select HAVE_IDE
118 select HAVE_IOREMAP_PROT 118 select HAVE_IOREMAP_PROT
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 24dd1a37f8fb..1f0667069940 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -122,7 +122,7 @@ KBUILD_CFLAGS += -mcpu=powerpc
122endif 122endif
123 123
124# Work around a gcc code-gen bug with -fno-omit-frame-pointer. 124# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
125ifeq ($(CONFIG_FTRACE),y) 125ifeq ($(CONFIG_FUNCTION_TRACER),y)
126KBUILD_CFLAGS += -mno-sched-epilog 126KBUILD_CFLAGS += -mno-sched-epilog
127endif 127endif
128 128
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index de921326cca8..b298f7a631e6 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_POWERPC_FTRACE 1#ifndef _ASM_POWERPC_FTRACE
2#define _ASM_POWERPC_FTRACE 2#define _ASM_POWERPC_FTRACE
3 3
4#ifdef CONFIG_FTRACE 4#ifdef CONFIG_FUNCTION_TRACER
5#define MCOUNT_ADDR ((long)(_mcount)) 5#define MCOUNT_ADDR ((long)(_mcount))
6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ 6#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
7 7
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index fdb58253fa5b..92673b43858d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -12,7 +12,7 @@ CFLAGS_prom_init.o += -fPIC
12CFLAGS_btext.o += -fPIC 12CFLAGS_btext.o += -fPIC
13endif 13endif
14 14
15ifdef CONFIG_FTRACE 15ifdef CONFIG_FUNCTION_TRACER
16# Do not trace early boot code 16# Do not trace early boot code
17CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog 17CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
18CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog 18CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 1cbbf7033641..7ecc0d1855c3 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1158,7 +1158,7 @@ machine_check_in_rtas:
1158 1158
1159#endif /* CONFIG_PPC_RTAS */ 1159#endif /* CONFIG_PPC_RTAS */
1160 1160
1161#ifdef CONFIG_FTRACE 1161#ifdef CONFIG_FUNCTION_TRACER
1162#ifdef CONFIG_DYNAMIC_FTRACE 1162#ifdef CONFIG_DYNAMIC_FTRACE
1163_GLOBAL(mcount) 1163_GLOBAL(mcount)
1164_GLOBAL(_mcount) 1164_GLOBAL(_mcount)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index fd8b4bae9b04..e6d52845854f 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -884,7 +884,7 @@ _GLOBAL(enter_prom)
884 mtlr r0 884 mtlr r0
885 blr 885 blr
886 886
887#ifdef CONFIG_FTRACE 887#ifdef CONFIG_FUNCTION_TRACER
888#ifdef CONFIG_DYNAMIC_FTRACE 888#ifdef CONFIG_DYNAMIC_FTRACE
889_GLOBAL(mcount) 889_GLOBAL(mcount)
890_GLOBAL(_mcount) 890_GLOBAL(_mcount)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 8edc2359c419..260089dccfb0 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(single_step_exception);
68EXPORT_SYMBOL(sys_sigreturn); 68EXPORT_SYMBOL(sys_sigreturn);
69#endif 69#endif
70 70
71#ifdef CONFIG_FTRACE 71#ifdef CONFIG_FUNCTION_TRACER
72EXPORT_SYMBOL(_mcount); 72EXPORT_SYMBOL(_mcount);
73#endif 73#endif
74 74
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index be60d64be7ad..50f169392551 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -1,6 +1,6 @@
1CFLAGS_bootx_init.o += -fPIC 1CFLAGS_bootx_init.o += -fPIC
2 2
3ifdef CONFIG_FTRACE 3ifdef CONFIG_FUNCTION_TRACER
4# Do not trace early boot code 4# Do not trace early boot code
5CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog 5CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog
6endif 6endif
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 035b15af90d8..824f6122e1a5 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -12,7 +12,7 @@ config SPARC64
12 bool 12 bool
13 default y 13 default y
14 select HAVE_DYNAMIC_FTRACE 14 select HAVE_DYNAMIC_FTRACE
15 select HAVE_FTRACE 15 select HAVE_FUNCTION_TRACER
16 select HAVE_IDE 16 select HAVE_IDE
17 select HAVE_LMB 17 select HAVE_LMB
18 select HAVE_ARCH_KGDB 18 select HAVE_ARCH_KGDB
diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug
index d6d32d178fc8..c40515c06690 100644
--- a/arch/sparc64/Kconfig.debug
+++ b/arch/sparc64/Kconfig.debug
@@ -33,7 +33,7 @@ config DEBUG_PAGEALLOC
33 33
34config MCOUNT 34config MCOUNT
35 bool 35 bool
36 depends on STACK_DEBUG || FTRACE 36 depends on STACK_DEBUG || FUNCTION_TRACER
37 default y 37 default y
38 38
39config FRAME_POINTER 39config FRAME_POINTER
diff --git a/arch/sparc64/lib/mcount.S b/arch/sparc64/lib/mcount.S
index fad90ddb3a28..7ce9c65f3592 100644
--- a/arch/sparc64/lib/mcount.S
+++ b/arch/sparc64/lib/mcount.S
@@ -93,7 +93,7 @@ mcount:
93 nop 93 nop
941: 941:
95#endif 95#endif
96#ifdef CONFIG_FTRACE 96#ifdef CONFIG_FUNCTION_TRACER
97#ifdef CONFIG_DYNAMIC_FTRACE 97#ifdef CONFIG_DYNAMIC_FTRACE
98 mov %o7, %o0 98 mov %o7, %o0
99 .globl mcount_call 99 .globl mcount_call
@@ -119,7 +119,7 @@ mcount_call:
119 .size _mcount,.-_mcount 119 .size _mcount,.-_mcount
120 .size mcount,.-mcount 120 .size mcount,.-mcount
121 121
122#ifdef CONFIG_FTRACE 122#ifdef CONFIG_FUNCTION_TRACER
123 .globl ftrace_stub 123 .globl ftrace_stub
124 .type ftrace_stub,#function 124 .type ftrace_stub,#function
125ftrace_stub: 125ftrace_stub:
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5b9b12321ad1..100325c8605e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,7 +28,7 @@ config X86
28 select HAVE_KRETPROBES 28 select HAVE_KRETPROBES
29 select HAVE_FTRACE_MCOUNT_RECORD 29 select HAVE_FTRACE_MCOUNT_RECORD
30 select HAVE_DYNAMIC_FTRACE 30 select HAVE_DYNAMIC_FTRACE
31 select HAVE_FTRACE 31 select HAVE_FUNCTION_TRACER
32 select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) 32 select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
33 select HAVE_ARCH_KGDB if !X86_VOYAGER 33 select HAVE_ARCH_KGDB if !X86_VOYAGER
34 select HAVE_ARCH_TRACEHOOK 34 select HAVE_ARCH_TRACEHOOK
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index d7e5a58ee22f..f1283fe60723 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -6,7 +6,7 @@ extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinu
6 6
7CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) 7CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
8 8
9ifdef CONFIG_FTRACE 9ifdef CONFIG_FUNCTION_TRACER
10# Do not profile debug and lowlevel utilities 10# Do not profile debug and lowlevel utilities
11CFLAGS_REMOVE_tsc.o = -pg 11CFLAGS_REMOVE_tsc.o = -pg
12CFLAGS_REMOVE_rtc.o = -pg 12CFLAGS_REMOVE_rtc.o = -pg
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c356423a6026..008cc17521c3 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1149,7 +1149,7 @@ ENDPROC(xen_failsafe_callback)
1149 1149
1150#endif /* CONFIG_XEN */ 1150#endif /* CONFIG_XEN */
1151 1151
1152#ifdef CONFIG_FTRACE 1152#ifdef CONFIG_FUNCTION_TRACER
1153#ifdef CONFIG_DYNAMIC_FTRACE 1153#ifdef CONFIG_DYNAMIC_FTRACE
1154 1154
1155ENTRY(mcount) 1155ENTRY(mcount)
@@ -1204,7 +1204,7 @@ trace:
1204 jmp ftrace_stub 1204 jmp ftrace_stub
1205END(mcount) 1205END(mcount)
1206#endif /* CONFIG_DYNAMIC_FTRACE */ 1206#endif /* CONFIG_DYNAMIC_FTRACE */
1207#endif /* CONFIG_FTRACE */ 1207#endif /* CONFIG_FUNCTION_TRACER */
1208 1208
1209.section .rodata,"a" 1209.section .rodata,"a"
1210#include "syscall_table_32.S" 1210#include "syscall_table_32.S"
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 09e7145484c5..b86f332c96a6 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -61,7 +61,7 @@
61 61
62 .code64 62 .code64
63 63
64#ifdef CONFIG_FTRACE 64#ifdef CONFIG_FUNCTION_TRACER
65#ifdef CONFIG_DYNAMIC_FTRACE 65#ifdef CONFIG_DYNAMIC_FTRACE
66ENTRY(mcount) 66ENTRY(mcount)
67 retq 67 retq
@@ -138,7 +138,7 @@ trace:
138 jmp ftrace_stub 138 jmp ftrace_stub
139END(mcount) 139END(mcount)
140#endif /* CONFIG_DYNAMIC_FTRACE */ 140#endif /* CONFIG_DYNAMIC_FTRACE */
141#endif /* CONFIG_FTRACE */ 141#endif /* CONFIG_FUNCTION_TRACER */
142 142
143#ifndef CONFIG_PREEMPT 143#ifndef CONFIG_PREEMPT
144#define retint_kernel retint_restore_args 144#define retint_kernel retint_restore_args
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index d073d981a730..8821ceabf51d 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
62 unsigned char *new_code) 62 unsigned char *new_code)
63{ 63{
64 unsigned char replaced[MCOUNT_INSN_SIZE]; 64 unsigned char replaced[MCOUNT_INSN_SIZE];
65 int ret;
65 66
66 /* 67 /*
67 * Note: Due to modules and __init, code can 68 * Note: Due to modules and __init, code can
@@ -77,8 +78,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
77 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) 78 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
78 return 2; 79 return 2;
79 80
80 WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, 81 ret = __copy_to_user_inatomic((char __user *)ip, new_code,
81 MCOUNT_INSN_SIZE)); 82 MCOUNT_INSN_SIZE);
83 WARN_ON_ONCE(ret);
82 84
83 sync_core(); 85 sync_core();
84 86
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c
index dd7ebee446af..43cec6bdda63 100644
--- a/arch/x86/kernel/i386_ksyms_32.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
@@ -5,7 +5,7 @@
5#include <asm/desc.h> 5#include <asm/desc.h>
6#include <asm/ftrace.h> 6#include <asm/ftrace.h>
7 7
8#ifdef CONFIG_FTRACE 8#ifdef CONFIG_FUNCTION_TRACER
9/* mcount is defined in assembly */ 9/* mcount is defined in assembly */
10EXPORT_SYMBOL(mcount); 10EXPORT_SYMBOL(mcount);
11#endif 11#endif
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index b545f371b5f5..695e426aa354 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -12,7 +12,7 @@
12#include <asm/desc.h> 12#include <asm/desc.h>
13#include <asm/ftrace.h> 13#include <asm/ftrace.h>
14 14
15#ifdef CONFIG_FTRACE 15#ifdef CONFIG_FUNCTION_TRACER
16/* mcount is defined in assembly */ 16/* mcount is defined in assembly */
17EXPORT_SYMBOL(mcount); 17EXPORT_SYMBOL(mcount);
18#endif 18#endif
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 313947940a1a..6dcefba7836f 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -1,4 +1,4 @@
1ifdef CONFIG_FTRACE 1ifdef CONFIG_FUNCTION_TRACER
2# Do not profile debug and lowlevel utilities 2# Do not profile debug and lowlevel utilities
3CFLAGS_REMOVE_spinlock.o = -pg 3CFLAGS_REMOVE_spinlock.o = -pg
4CFLAGS_REMOVE_time.o = -pg 4CFLAGS_REMOVE_time.o = -pg
diff --git a/include/asm-x86/ftrace.h b/include/asm-x86/ftrace.h
index 1bb6f9bbe1ab..233bb9b869c0 100644
--- a/include/asm-x86/ftrace.h
+++ b/include/asm-x86/ftrace.h
@@ -1,7 +1,7 @@
1#ifndef ASM_X86__FTRACE_H 1#ifndef ASM_X86__FTRACE_H
2#define ASM_X86__FTRACE_H 2#define ASM_X86__FTRACE_H
3 3
4#ifdef CONFIG_FTRACE 4#ifdef CONFIG_FUNCTION_TRACER
5#define MCOUNT_ADDR ((long)(mcount)) 5#define MCOUNT_ADDR ((long)(mcount))
6#define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ 6#define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
7 7
@@ -19,6 +19,6 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
19} 19}
20#endif 20#endif
21 21
22#endif /* CONFIG_FTRACE */ 22#endif /* CONFIG_FUNCTION_TRACER */
23 23
24#endif /* ASM_X86__FTRACE_H */ 24#endif /* ASM_X86__FTRACE_H */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index a3d46151be19..0e9529589151 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -8,7 +8,7 @@
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/kallsyms.h> 9#include <linux/kallsyms.h>
10 10
11#ifdef CONFIG_FTRACE 11#ifdef CONFIG_FUNCTION_TRACER
12 12
13extern int ftrace_enabled; 13extern int ftrace_enabled;
14extern int 14extern int
@@ -36,12 +36,12 @@ void clear_ftrace_function(void);
36 36
37extern void ftrace_stub(unsigned long a0, unsigned long a1); 37extern void ftrace_stub(unsigned long a0, unsigned long a1);
38 38
39#else /* !CONFIG_FTRACE */ 39#else /* !CONFIG_FUNCTION_TRACER */
40# define register_ftrace_function(ops) do { } while (0) 40# define register_ftrace_function(ops) do { } while (0)
41# define unregister_ftrace_function(ops) do { } while (0) 41# define unregister_ftrace_function(ops) do { } while (0)
42# define clear_ftrace_function(ops) do { } while (0) 42# define clear_ftrace_function(ops) do { } while (0)
43static inline void ftrace_kill_atomic(void) { } 43static inline void ftrace_kill_atomic(void) { }
44#endif /* CONFIG_FTRACE */ 44#endif /* CONFIG_FUNCTION_TRACER */
45 45
46#ifdef CONFIG_DYNAMIC_FTRACE 46#ifdef CONFIG_DYNAMIC_FTRACE
47# define FTRACE_HASHBITS 10 47# define FTRACE_HASHBITS 10
@@ -101,7 +101,7 @@ void ftrace_kill_atomic(void);
101 101
102static inline void tracer_disable(void) 102static inline void tracer_disable(void)
103{ 103{
104#ifdef CONFIG_FTRACE 104#ifdef CONFIG_FUNCTION_TRACER
105 ftrace_enabled = 0; 105 ftrace_enabled = 0;
106#endif 106#endif
107} 107}
@@ -113,7 +113,7 @@ static inline void tracer_disable(void)
113 */ 113 */
114static inline int __ftrace_enabled_save(void) 114static inline int __ftrace_enabled_save(void)
115{ 115{
116#ifdef CONFIG_FTRACE 116#ifdef CONFIG_FUNCTION_TRACER
117 int saved_ftrace_enabled = ftrace_enabled; 117 int saved_ftrace_enabled = ftrace_enabled;
118 ftrace_enabled = 0; 118 ftrace_enabled = 0;
119 return saved_ftrace_enabled; 119 return saved_ftrace_enabled;
@@ -124,7 +124,7 @@ static inline int __ftrace_enabled_save(void)
124 124
125static inline void __ftrace_enabled_restore(int enabled) 125static inline void __ftrace_enabled_restore(int enabled)
126{ 126{
127#ifdef CONFIG_FTRACE 127#ifdef CONFIG_FUNCTION_TRACER
128 ftrace_enabled = enabled; 128 ftrace_enabled = enabled;
129#endif 129#endif
130} 130}
diff --git a/kernel/Makefile b/kernel/Makefile
index 305f11dbef21..9a3ec66a9d84 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -13,7 +13,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
13 13
14CFLAGS_REMOVE_sched.o = -mno-spe 14CFLAGS_REMOVE_sched.o = -mno-spe
15 15
16ifdef CONFIG_FTRACE 16ifdef CONFIG_FUNCTION_TRACER
17# Do not trace debug files and internal ftrace files 17# Do not trace debug files and internal ftrace files
18CFLAGS_REMOVE_lockdep.o = -pg 18CFLAGS_REMOVE_lockdep.o = -pg
19CFLAGS_REMOVE_lockdep_proc.o = -pg 19CFLAGS_REMOVE_lockdep_proc.o = -pg
@@ -88,7 +88,7 @@ obj-$(CONFIG_MARKERS) += marker.o
88obj-$(CONFIG_TRACEPOINTS) += tracepoint.o 88obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
89obj-$(CONFIG_LATENCYTOP) += latencytop.o 89obj-$(CONFIG_LATENCYTOP) += latencytop.o
90obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o 90obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
91obj-$(CONFIG_FTRACE) += trace/ 91obj-$(CONFIG_FUNCTION_TRACER) += trace/
92obj-$(CONFIG_TRACING) += trace/ 92obj-$(CONFIG_TRACING) += trace/
93obj-$(CONFIG_SMP) += sched_cpupri.o 93obj-$(CONFIG_SMP) += sched_cpupri.o
94 94
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index b3cc73931d1f..edb1075f80d2 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -464,7 +464,7 @@ static struct ctl_table kern_table[] = {
464 .mode = 0644, 464 .mode = 0644,
465 .proc_handler = &proc_dointvec, 465 .proc_handler = &proc_dointvec,
466 }, 466 },
467#ifdef CONFIG_FTRACE 467#ifdef CONFIG_FUNCTION_TRACER
468 { 468 {
469 .ctl_name = CTL_UNNUMBERED, 469 .ctl_name = CTL_UNNUMBERED,
470 .procname = "ftrace_enabled", 470 .procname = "ftrace_enabled",
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 1cb3e1f616af..3533c583df47 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -1,11 +1,12 @@
1# 1#
2# Architectures that offer an FTRACE implementation should select HAVE_FTRACE: 2# Architectures that offer an FUNCTION_TRACER implementation should
3# select HAVE_FUNCTION_TRACER:
3# 4#
4 5
5config NOP_TRACER 6config NOP_TRACER
6 bool 7 bool
7 8
8config HAVE_FTRACE 9config HAVE_FUNCTION_TRACER
9 bool 10 bool
10 select NOP_TRACER 11 select NOP_TRACER
11 12
@@ -28,9 +29,9 @@ config TRACING
28 select STACKTRACE 29 select STACKTRACE
29 select TRACEPOINTS 30 select TRACEPOINTS
30 31
31config FTRACE 32config FUNCTION_TRACER
32 bool "Kernel Function Tracer" 33 bool "Kernel Function Tracer"
33 depends on HAVE_FTRACE 34 depends on HAVE_FUNCTION_TRACER
34 depends on DEBUG_KERNEL 35 depends on DEBUG_KERNEL
35 select FRAME_POINTER 36 select FRAME_POINTER
36 select TRACING 37 select TRACING
@@ -49,7 +50,6 @@ config IRQSOFF_TRACER
49 default n 50 default n
50 depends on TRACE_IRQFLAGS_SUPPORT 51 depends on TRACE_IRQFLAGS_SUPPORT
51 depends on GENERIC_TIME 52 depends on GENERIC_TIME
52 depends on HAVE_FTRACE
53 depends on DEBUG_KERNEL 53 depends on DEBUG_KERNEL
54 select TRACE_IRQFLAGS 54 select TRACE_IRQFLAGS
55 select TRACING 55 select TRACING
@@ -73,7 +73,6 @@ config PREEMPT_TRACER
73 default n 73 default n
74 depends on GENERIC_TIME 74 depends on GENERIC_TIME
75 depends on PREEMPT 75 depends on PREEMPT
76 depends on HAVE_FTRACE
77 depends on DEBUG_KERNEL 76 depends on DEBUG_KERNEL
78 select TRACING 77 select TRACING
79 select TRACER_MAX_TRACE 78 select TRACER_MAX_TRACE
@@ -101,7 +100,6 @@ config SYSPROF_TRACER
101 100
102config SCHED_TRACER 101config SCHED_TRACER
103 bool "Scheduling Latency Tracer" 102 bool "Scheduling Latency Tracer"
104 depends on HAVE_FTRACE
105 depends on DEBUG_KERNEL 103 depends on DEBUG_KERNEL
106 select TRACING 104 select TRACING
107 select CONTEXT_SWITCH_TRACER 105 select CONTEXT_SWITCH_TRACER
@@ -112,7 +110,6 @@ config SCHED_TRACER
112 110
113config CONTEXT_SWITCH_TRACER 111config CONTEXT_SWITCH_TRACER
114 bool "Trace process context switches" 112 bool "Trace process context switches"
115 depends on HAVE_FTRACE
116 depends on DEBUG_KERNEL 113 depends on DEBUG_KERNEL
117 select TRACING 114 select TRACING
118 select MARKERS 115 select MARKERS
@@ -122,7 +119,6 @@ config CONTEXT_SWITCH_TRACER
122 119
123config BOOT_TRACER 120config BOOT_TRACER
124 bool "Trace boot initcalls" 121 bool "Trace boot initcalls"
125 depends on HAVE_FTRACE
126 depends on DEBUG_KERNEL 122 depends on DEBUG_KERNEL
127 select TRACING 123 select TRACING
128 help 124 help
@@ -141,9 +137,9 @@ config BOOT_TRACER
141 137
142config STACK_TRACER 138config STACK_TRACER
143 bool "Trace max stack" 139 bool "Trace max stack"
144 depends on HAVE_FTRACE 140 depends on HAVE_FUNCTION_TRACER
145 depends on DEBUG_KERNEL 141 depends on DEBUG_KERNEL
146 select FTRACE 142 select FUNCTION_TRACER
147 select STACKTRACE 143 select STACKTRACE
148 help 144 help
149 This special tracer records the maximum stack footprint of the 145 This special tracer records the maximum stack footprint of the
@@ -160,7 +156,7 @@ config STACK_TRACER
160 156
161config DYNAMIC_FTRACE 157config DYNAMIC_FTRACE
162 bool "enable/disable ftrace tracepoints dynamically" 158 bool "enable/disable ftrace tracepoints dynamically"
163 depends on FTRACE 159 depends on FUNCTION_TRACER
164 depends on HAVE_DYNAMIC_FTRACE 160 depends on HAVE_DYNAMIC_FTRACE
165 depends on DEBUG_KERNEL 161 depends on DEBUG_KERNEL
166 default y 162 default y
@@ -170,7 +166,7 @@ config DYNAMIC_FTRACE
170 with a No-Op instruction) as they are called. A table is 166 with a No-Op instruction) as they are called. A table is
171 created to dynamically enable them again. 167 created to dynamically enable them again.
172 168
173 This way a CONFIG_FTRACE kernel is slightly larger, but otherwise 169 This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise
174 has native performance as long as no tracing is active. 170 has native performance as long as no tracing is active.
175 171
176 The changes to the code are done by a kernel thread that 172 The changes to the code are done by a kernel thread that
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index a85dfba88ba0..c8228b1a49e9 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -1,7 +1,7 @@
1 1
2# Do not instrument the tracer itself: 2# Do not instrument the tracer itself:
3 3
4ifdef CONFIG_FTRACE 4ifdef CONFIG_FUNCTION_TRACER
5ORIG_CFLAGS := $(KBUILD_CFLAGS) 5ORIG_CFLAGS := $(KBUILD_CFLAGS)
6KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS)) 6KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
7 7
@@ -10,13 +10,13 @@ CFLAGS_trace_selftest_dynamic.o = -pg
10obj-y += trace_selftest_dynamic.o 10obj-y += trace_selftest_dynamic.o
11endif 11endif
12 12
13obj-$(CONFIG_FTRACE) += libftrace.o 13obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
14obj-$(CONFIG_RING_BUFFER) += ring_buffer.o 14obj-$(CONFIG_RING_BUFFER) += ring_buffer.o
15 15
16obj-$(CONFIG_TRACING) += trace.o 16obj-$(CONFIG_TRACING) += trace.o
17obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o 17obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o
18obj-$(CONFIG_SYSPROF_TRACER) += trace_sysprof.o 18obj-$(CONFIG_SYSPROF_TRACER) += trace_sysprof.o
19obj-$(CONFIG_FTRACE) += trace_functions.o 19obj-$(CONFIG_FUNCTION_TRACER) += trace_functions.o
20obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o 20obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
21obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o 21obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
22obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o 22obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 4dda4f60a2a9..1f54a94189fe 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -164,10 +164,14 @@ static DEFINE_SPINLOCK(ftrace_hash_lock);
164#define ftrace_hash_lock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags) 164#define ftrace_hash_lock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags)
165#define ftrace_hash_unlock(flags) \ 165#define ftrace_hash_unlock(flags) \
166 spin_unlock_irqrestore(&ftrace_hash_lock, flags) 166 spin_unlock_irqrestore(&ftrace_hash_lock, flags)
167static void ftrace_release_hash(unsigned long start, unsigned long end);
167#else 168#else
168/* This is protected via the ftrace_lock with MCOUNT_RECORD. */ 169/* This is protected via the ftrace_lock with MCOUNT_RECORD. */
169#define ftrace_hash_lock(flags) do { (void)(flags); } while (0) 170#define ftrace_hash_lock(flags) do { (void)(flags); } while (0)
170#define ftrace_hash_unlock(flags) do { } while(0) 171#define ftrace_hash_unlock(flags) do { } while(0)
172static inline void ftrace_release_hash(unsigned long start, unsigned long end)
173{
174}
171#endif 175#endif
172 176
173/* 177/*
@@ -347,6 +351,7 @@ void ftrace_release(void *start, unsigned long size)
347 } 351 }
348 spin_unlock(&ftrace_lock); 352 spin_unlock(&ftrace_lock);
349 353
354 ftrace_release_hash(s, e);
350} 355}
351 356
352static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip) 357static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip)
@@ -1659,6 +1664,44 @@ void __init ftrace_init(void)
1659 ftrace_disabled = 1; 1664 ftrace_disabled = 1;
1660} 1665}
1661#else /* CONFIG_FTRACE_MCOUNT_RECORD */ 1666#else /* CONFIG_FTRACE_MCOUNT_RECORD */
1667
1668static void ftrace_release_hash(unsigned long start, unsigned long end)
1669{
1670 struct dyn_ftrace *rec;
1671 struct hlist_node *t, *n;
1672 struct hlist_head *head, temp_list;
1673 unsigned long flags;
1674 int i, cpu;
1675
1676 preempt_disable_notrace();
1677
1678 /* disable incase we call something that calls mcount */
1679 cpu = raw_smp_processor_id();
1680 per_cpu(ftrace_shutdown_disable_cpu, cpu)++;
1681
1682 ftrace_hash_lock(flags);
1683
1684 for (i = 0; i < FTRACE_HASHSIZE; i++) {
1685 INIT_HLIST_HEAD(&temp_list);
1686 head = &ftrace_hash[i];
1687
1688 /* all CPUS are stopped, we are safe to modify code */
1689 hlist_for_each_entry_safe(rec, t, n, head, node) {
1690 if (rec->flags & FTRACE_FL_FREE)
1691 continue;
1692
1693 if ((rec->ip >= start) && (rec->ip < end))
1694 ftrace_free_rec(rec);
1695 }
1696 }
1697
1698 ftrace_hash_unlock(flags);
1699
1700 per_cpu(ftrace_shutdown_disable_cpu, cpu)--;
1701 preempt_enable_notrace();
1702
1703}
1704
1662static int ftraced(void *ignore) 1705static int ftraced(void *ignore)
1663{ 1706{
1664 unsigned long usecs; 1707 unsigned long usecs;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d345d649d073..aeb2f2505bc5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -851,7 +851,7 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
851 preempt_enable_notrace(); 851 preempt_enable_notrace();
852} 852}
853 853
854#ifdef CONFIG_FTRACE 854#ifdef CONFIG_FUNCTION_TRACER
855static void 855static void
856function_trace_call(unsigned long ip, unsigned long parent_ip) 856function_trace_call(unsigned long ip, unsigned long parent_ip)
857{ 857{
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index f1f99572cde7..6889ca48f1f1 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -335,7 +335,7 @@ void update_max_tr_single(struct trace_array *tr,
335 335
336extern cycle_t ftrace_now(int cpu); 336extern cycle_t ftrace_now(int cpu);
337 337
338#ifdef CONFIG_FTRACE 338#ifdef CONFIG_FUNCTION_TRACER
339void tracing_start_function_trace(void); 339void tracing_start_function_trace(void);
340void tracing_stop_function_trace(void); 340void tracing_stop_function_trace(void);
341#else 341#else
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index e90eb0c2c56c..0f85a64003d3 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -64,7 +64,7 @@ static void function_trace_ctrl_update(struct trace_array *tr)
64 64
65static struct tracer function_trace __read_mostly = 65static struct tracer function_trace __read_mostly =
66{ 66{
67 .name = "ftrace", 67 .name = "function",
68 .init = function_trace_init, 68 .init = function_trace_init,
69 .reset = function_trace_reset, 69 .reset = function_trace_reset,
70 .ctrl_update = function_trace_ctrl_update, 70 .ctrl_update = function_trace_ctrl_update,
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index a7db7f040ae0..9c74071c10e0 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -63,7 +63,7 @@ irq_trace(void)
63 */ 63 */
64static __cacheline_aligned_in_smp unsigned long max_sequence; 64static __cacheline_aligned_in_smp unsigned long max_sequence;
65 65
66#ifdef CONFIG_FTRACE 66#ifdef CONFIG_FUNCTION_TRACER
67/* 67/*
68 * irqsoff uses its own tracer function to keep the overhead down: 68 * irqsoff uses its own tracer function to keep the overhead down:
69 */ 69 */
@@ -104,7 +104,7 @@ static struct ftrace_ops trace_ops __read_mostly =
104{ 104{
105 .func = irqsoff_tracer_call, 105 .func = irqsoff_tracer_call,
106}; 106};
107#endif /* CONFIG_FTRACE */ 107#endif /* CONFIG_FUNCTION_TRACER */
108 108
109/* 109/*
110 * Should this new latency be reported/recorded? 110 * Should this new latency be reported/recorded?
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index fe4a252c2363..3ae93f16b565 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -31,7 +31,7 @@ static raw_spinlock_t wakeup_lock =
31 31
32static void __wakeup_reset(struct trace_array *tr); 32static void __wakeup_reset(struct trace_array *tr);
33 33
34#ifdef CONFIG_FTRACE 34#ifdef CONFIG_FUNCTION_TRACER
35/* 35/*
36 * irqsoff uses its own tracer function to keep the overhead down: 36 * irqsoff uses its own tracer function to keep the overhead down:
37 */ 37 */
@@ -96,7 +96,7 @@ static struct ftrace_ops trace_ops __read_mostly =
96{ 96{
97 .func = wakeup_tracer_call, 97 .func = wakeup_tracer_call,
98}; 98};
99#endif /* CONFIG_FTRACE */ 99#endif /* CONFIG_FUNCTION_TRACER */
100 100
101/* 101/*
102 * Should this new latency be reported/recorded? 102 * Should this new latency be reported/recorded?
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index 09cf230d7eca..95815d26a041 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -70,7 +70,7 @@ static int trace_test_buffer(struct trace_array *tr, unsigned long *count)
70 return ret; 70 return ret;
71} 71}
72 72
73#ifdef CONFIG_FTRACE 73#ifdef CONFIG_FUNCTION_TRACER
74 74
75#ifdef CONFIG_DYNAMIC_FTRACE 75#ifdef CONFIG_DYNAMIC_FTRACE
76 76
@@ -226,7 +226,7 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
226 226
227 return ret; 227 return ret;
228} 228}
229#endif /* CONFIG_FTRACE */ 229#endif /* CONFIG_FUNCTION_TRACER */
230 230
231#ifdef CONFIG_IRQSOFF_TRACER 231#ifdef CONFIG_IRQSOFF_TRACER
232int 232int
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 74c5d9a3afae..be682b62fe58 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -44,6 +44,10 @@ static inline void check_stack(void)
44 if (this_size <= max_stack_size) 44 if (this_size <= max_stack_size)
45 return; 45 return;
46 46
47 /* we do not handle interrupt stacks yet */
48 if (!object_is_on_stack(&this_size))
49 return;
50
47 raw_local_irq_save(flags); 51 raw_local_irq_save(flags);
48 __raw_spin_lock(&max_stack_lock); 52 __raw_spin_lock(&max_stack_lock);
49 53
diff --git a/lib/Makefile b/lib/Makefile
index 16feaab057b2..7cb65d85aeb0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for some libs needed in the kernel. 2# Makefile for some libs needed in the kernel.
3# 3#
4 4
5ifdef CONFIG_FTRACE 5ifdef CONFIG_FUNCTION_TRACER
6ORIG_CFLAGS := $(KBUILD_CFLAGS) 6ORIG_CFLAGS := $(KBUILD_CFLAGS)
7KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS)) 7KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
8endif 8endif