diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-12-05 21:40:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 09:11:44 -0500 |
commit | 8b96f0119818964e4944fd1c423bf6770027d3ac (patch) | |
tree | 02b5ec86d2fe45d6935d63913b997989f9339bf4 /kernel | |
parent | decbec3838d10ecd7aabdb4c0e05aac0e5f5dc0c (diff) |
tracing/function-graph-tracer: introduce __notrace_funcgraph to filter special functions
Impact: trace more functions
When the function graph tracer is configured, three more files are not
traced to prevent only four functions to be traced. And this impacts the
normal function tracer too.
arch/x86/kernel/process_64/32.c:
I had crashes when I let this file traced. After some debugging, I saw
that the "current" task point was changed inside__swtich_to(), ie:
"write_pda(pcurrent, next_p);" inside process_64.c Since the tracer store
the original return address of the function inside current, we had
crashes. Only __switch_to() has to be excluded from tracing.
kernel/module.c and kernel/extable.c:
Because of a function used internally by the function graph tracer:
__kernel_text_address()
To let the other functions inside these files to be traced, this patch
introduces the __notrace_funcgraph function prefix which is __notrace if
function graph tracer is configured and nothing if not.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/Makefile | 4 | ||||
-rw-r--r-- | kernel/extable.c | 5 | ||||
-rw-r--r-- | kernel/module.c | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 703cf3b7389c..19fad003b19d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -21,10 +21,6 @@ CFLAGS_REMOVE_cgroup-debug.o = -pg | |||
21 | CFLAGS_REMOVE_sched_clock.o = -pg | 21 | CFLAGS_REMOVE_sched_clock.o = -pg |
22 | CFLAGS_REMOVE_sched.o = -pg | 22 | CFLAGS_REMOVE_sched.o = -pg |
23 | endif | 23 | endif |
24 | ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
25 | CFLAGS_REMOVE_extable.o = -pg # For __kernel_text_address() | ||
26 | CFLAGS_REMOVE_module.o = -pg # For __module_text_address() | ||
27 | endif | ||
28 | 24 | ||
29 | obj-$(CONFIG_FREEZER) += freezer.o | 25 | obj-$(CONFIG_FREEZER) += freezer.o |
30 | obj-$(CONFIG_PROFILING) += profile.o | 26 | obj-$(CONFIG_PROFILING) += profile.o |
diff --git a/kernel/extable.c b/kernel/extable.c index a26cb2e17023..feb0317cf09a 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/ftrace.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/sections.h> | 22 | #include <asm/sections.h> |
22 | 23 | ||
@@ -40,7 +41,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) | |||
40 | return e; | 41 | return e; |
41 | } | 42 | } |
42 | 43 | ||
43 | int core_kernel_text(unsigned long addr) | 44 | __notrace_funcgraph int core_kernel_text(unsigned long addr) |
44 | { | 45 | { |
45 | if (addr >= (unsigned long)_stext && | 46 | if (addr >= (unsigned long)_stext && |
46 | addr <= (unsigned long)_etext) | 47 | addr <= (unsigned long)_etext) |
@@ -53,7 +54,7 @@ int core_kernel_text(unsigned long addr) | |||
53 | return 0; | 54 | return 0; |
54 | } | 55 | } |
55 | 56 | ||
56 | int __kernel_text_address(unsigned long addr) | 57 | __notrace_funcgraph int __kernel_text_address(unsigned long addr) |
57 | { | 58 | { |
58 | if (core_kernel_text(addr)) | 59 | if (core_kernel_text(addr)) |
59 | return 1; | 60 | return 1; |
diff --git a/kernel/module.c b/kernel/module.c index 89bcf7c1327d..dd2a54155b54 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2704,7 +2704,7 @@ int is_module_address(unsigned long addr) | |||
2704 | 2704 | ||
2705 | 2705 | ||
2706 | /* Is this a valid kernel address? */ | 2706 | /* Is this a valid kernel address? */ |
2707 | struct module *__module_text_address(unsigned long addr) | 2707 | __notrace_funcgraph struct module *__module_text_address(unsigned long addr) |
2708 | { | 2708 | { |
2709 | struct module *mod; | 2709 | struct module *mod; |
2710 | 2710 | ||