Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147321
b: refs/heads/master
c: 5872bdb
h: refs/heads/master
i:
  147319: f08e718
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 6, 2009
1 parent fdbe519 commit 07a31f6
Show file tree
Hide file tree
Showing 4 changed files with 13 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: 3df70fd623bb109e0079e697c0276d220a4b7908
refs/heads/master: 5872bdb88a35fae7d224bd6b21e5f377e854ccfc
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
{
unsigned long bp;
char *stack;
int nr = entry->nr;

callchain_store(entry, instruction_pointer(regs));

Expand All @@ -1099,6 +1100,8 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
#endif

dump_trace(NULL, regs, (void *)stack, bp, &backtrace_ops, entry);

entry->kernel = entry->nr - nr;
}


Expand Down Expand Up @@ -1128,6 +1131,7 @@ perf_callchain_user(struct pt_regs *regs, struct perf_callchain_entry *entry)
{
struct stack_frame frame;
const void __user *fp;
int nr = entry->nr;

regs = (struct pt_regs *)current->thread.sp0 - 1;
fp = (void __user *)regs->bp;
Expand All @@ -1147,6 +1151,8 @@ perf_callchain_user(struct pt_regs *regs, struct perf_callchain_entry *entry)
callchain_store(entry, frame.return_address);
fp = frame.next_fp;
}

entry->user = entry->nr - nr;
}

static void
Expand Down Expand Up @@ -1182,6 +1188,9 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
entry = &__get_cpu_var(irq_entry);

entry->nr = 0;
entry->hv = 0;
entry->kernel = 0;
entry->user = 0;

perf_do_callchain(regs, entry);

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ extern void perf_counter_mmap(unsigned long addr, unsigned long len,
extern void perf_counter_munmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file);

#define MAX_STACK_DEPTH 255
#define MAX_STACK_DEPTH 254

struct perf_callchain_entry {
u64 nr;
u32 nr, hv, kernel, user;
u64 ip[MAX_STACK_DEPTH];
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ void perf_counter_output(struct perf_counter *counter,
callchain = perf_callchain(regs);

if (callchain) {
callchain_size = (1 + callchain->nr) * sizeof(u64);
callchain_size = (2 + callchain->nr) * sizeof(u64);

header.type |= __PERF_EVENT_CALLCHAIN;
header.size += callchain_size;
Expand Down

0 comments on commit 07a31f6

Please sign in to comment.