Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20287
b: refs/heads/master
c: 3037944
h: refs/heads/master
i:
  20285: b2af7b4
  20283: 50b6105
  20279: d39435d
  20271: aa80f32
  20255: 7a7eda3
  20223: 69c3042
v: v3
  • Loading branch information
Gerald Britton authored and Linus Torvalds committed Feb 14, 2006
1 parent e60b647 commit db79bcd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b739db79a434aec89027a109d85de305e6bdeb93
refs/heads/master: 303794400992b907b7cac0d91788603636c7e0fe
19 changes: 16 additions & 3 deletions trunk/arch/i386/oprofile/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ struct frame_head {
} __attribute__((packed));

static struct frame_head *
dump_backtrace(struct frame_head * head)
dump_kernel_backtrace(struct frame_head * head)
{
oprofile_add_trace(head->ret);

/* frame pointers should strictly progress back up the stack
* (towards higher addresses) */
if (head >= head->ebp)
return NULL;

return head->ebp;
}

static struct frame_head *
dump_user_backtrace(struct frame_head * head)
{
struct frame_head bufhead[2];

Expand Down Expand Up @@ -105,10 +118,10 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)

if (!user_mode_vm(regs)) {
while (depth-- && valid_kernel_stack(head, regs))
head = dump_backtrace(head);
head = dump_kernel_backtrace(head);
return;
}

while (depth-- && head)
head = dump_backtrace(head);
head = dump_user_backtrace(head);
}

0 comments on commit db79bcd

Please sign in to comment.