aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-11-21 01:30:54 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-23 05:41:01 -0500
commit2bcd521a684cc94befbe2ce7d5b613c841b0d304 (patch)
tree63bc4dbc52defa27c8cac9e46dddadfcb36c1c7a /include/asm-generic
parentbac28bfe42ba98ee67503f78984d1d5e1ebbbb78 (diff)
trace: profile all if conditionals
Impact: feature to profile if statements This patch adds a branch profiler for all if () statements. The results will be found in: /debugfs/tracing/profile_branch For example: miss hit % Function File Line ------- --------- - -------- ---- ---- 0 1 100 x86_64_start_reservations head64.c 127 0 1 100 copy_bootdata head64.c 69 1 0 0 x86_64_start_kernel head64.c 111 32 0 0 set_intr_gate desc.h 319 1 0 0 reserve_ebda_region head.c 51 1 0 0 reserve_ebda_region head.c 47 0 1 100 reserve_ebda_region head.c 42 0 0 X maxcpus main.c 165 Miss means the branch was not taken. Hit means the branch was taken. The percent is the percentage the branch was taken. This adds a significant amount of overhead and should only be used by those analyzing their system. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/vmlinux.lds.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 8bccb49981e5..eba835a2c2cd 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -53,6 +53,14 @@
53#define LIKELY_PROFILE() 53#define LIKELY_PROFILE()
54#endif 54#endif
55 55
56#ifdef CONFIG_PROFILE_ALL_BRANCHES
57#define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
58 *(_ftrace_branch) \
59 VMLINUX_SYMBOL(__stop_branch_profile) = .;
60#else
61#define BRANCH_PROFILE()
62#endif
63
56/* .data section */ 64/* .data section */
57#define DATA_DATA \ 65#define DATA_DATA \
58 *(.data) \ 66 *(.data) \
@@ -72,7 +80,8 @@
72 VMLINUX_SYMBOL(__start___tracepoints) = .; \ 80 VMLINUX_SYMBOL(__start___tracepoints) = .; \
73 *(__tracepoints) \ 81 *(__tracepoints) \
74 VMLINUX_SYMBOL(__stop___tracepoints) = .; \ 82 VMLINUX_SYMBOL(__stop___tracepoints) = .; \
75 LIKELY_PROFILE() 83 LIKELY_PROFILE() \
84 BRANCH_PROFILE()
76 85
77#define RO_DATA(align) \ 86#define RO_DATA(align) \
78 . = ALIGN((align)); \ 87 . = ALIGN((align)); \