Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211907
b: refs/heads/master
c: 40c6b3c
h: refs/heads/master
i:
  211905: 7ac4aa2
  211903: b561b79
v: v3
  • Loading branch information
Jiri Olsa authored and Robert Richter committed Oct 1, 2010
1 parent 21ce9e6 commit de227ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 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: ef70fcc0cd5d98f5e2df82c9e598b47f351d4f66
refs/heads/master: 40c6b3cb64cd1d02322df5f729cca25084580f40
19 changes: 7 additions & 12 deletions trunk/arch/x86/oprofile/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,30 @@ static struct stacktrace_ops backtrace_ops = {
.walk_stack = print_context_stack,
};

struct frame_head {
struct frame_head *bp;
unsigned long ret;
} __attribute__((packed));

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

/* Also check accessibility of one struct frame_head beyond */
/* Also check accessibility of one struct stack_frame beyond */
if (!access_ok(VERIFY_READ, head, sizeof(bufhead)))
return NULL;
if (__copy_from_user_inatomic(bufhead, head, sizeof(bufhead)))
return NULL;

oprofile_add_trace(bufhead[0].ret);
oprofile_add_trace(bufhead[0].return_address);

/* frame pointers should strictly progress back up the stack
* (towards higher addresses) */
if (head >= bufhead[0].bp)
if (head >= bufhead[0].next_frame)
return NULL;

return bufhead[0].bp;
return bufhead[0].next_frame;
}

void
x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{
struct frame_head *head = (struct frame_head *)frame_pointer(regs);
struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);

if (!user_mode_vm(regs)) {
unsigned long stack = kernel_stack_pointer(regs);
Expand Down

0 comments on commit de227ab

Please sign in to comment.