diff options
author | Gerald Britton <gbritton@alum.mit.edu> | 2006-02-14 10:19:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-14 11:25:29 -0500 |
commit | 303794400992b907b7cac0d91788603636c7e0fe (patch) | |
tree | 012781f808f48d80b32e435a4f27b6e8524d0ff0 /arch/i386/oprofile | |
parent | b739db79a434aec89027a109d85de305e6bdeb93 (diff) |
[PATCH] x86: fix oprofile kernel callgraph regression
Fix x86 oprofile regression introduced by:
commit c34d1b4d165c67b966bca4aba026443d7ff161eb
[PATCH] mm: kill check_user_page_readable
That commit reorganized tests for the userspace stack walking moving all
those tests into dump_backtrace(), however, dump_backtrace() was used for
both userspace and kernel stalk walking. The result is typically no
recorded callgraph information for kernel samples.
Revive the original function as dump_kernel_backtrace() and rename the
other to dump_user_backtrace() to avoid future confusion.
Signed-off-by: Gerald Britton <gbritton@alum.mit.edu>
Apology-from: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/oprofile')
-rw-r--r-- | arch/i386/oprofile/backtrace.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/i386/oprofile/backtrace.c b/arch/i386/oprofile/backtrace.c index acc18138fb22..c049ce414f01 100644 --- a/arch/i386/oprofile/backtrace.c +++ b/arch/i386/oprofile/backtrace.c | |||
@@ -20,7 +20,20 @@ struct frame_head { | |||
20 | } __attribute__((packed)); | 20 | } __attribute__((packed)); |
21 | 21 | ||
22 | static struct frame_head * | 22 | static struct frame_head * |
23 | dump_backtrace(struct frame_head * head) | 23 | dump_kernel_backtrace(struct frame_head * head) |
24 | { | ||
25 | oprofile_add_trace(head->ret); | ||
26 | |||
27 | /* frame pointers should strictly progress back up the stack | ||
28 | * (towards higher addresses) */ | ||
29 | if (head >= head->ebp) | ||
30 | return NULL; | ||
31 | |||
32 | return head->ebp; | ||
33 | } | ||
34 | |||
35 | static struct frame_head * | ||
36 | dump_user_backtrace(struct frame_head * head) | ||
24 | { | 37 | { |
25 | struct frame_head bufhead[2]; | 38 | struct frame_head bufhead[2]; |
26 | 39 | ||
@@ -105,10 +118,10 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth) | |||
105 | 118 | ||
106 | if (!user_mode_vm(regs)) { | 119 | if (!user_mode_vm(regs)) { |
107 | while (depth-- && valid_kernel_stack(head, regs)) | 120 | while (depth-- && valid_kernel_stack(head, regs)) |
108 | head = dump_backtrace(head); | 121 | head = dump_kernel_backtrace(head); |
109 | return; | 122 | return; |
110 | } | 123 | } |
111 | 124 | ||
112 | while (depth-- && head) | 125 | while (depth-- && head) |
113 | head = dump_backtrace(head); | 126 | head = dump_user_backtrace(head); |
114 | } | 127 | } |