Skip to content

Commit

Permalink
powerpc/perf: Use perf_instruction_pointer in callchains
Browse files Browse the repository at this point in the history
We use SIAR or regs->nip for the instruction pointer depending on
the PMU configuration, but we always use regs->nip in the callchain.

Use perf_instruction_pointer so the backtrace is consistent.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Jul 10, 2012
1 parent 5c093ef commit 6da7094
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/powerpc/perf/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs)

lr = regs->link;
sp = regs->gpr[1];
perf_callchain_store(entry, regs->nip);
perf_callchain_store(entry, perf_instruction_pointer(regs));

if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
return;
Expand Down Expand Up @@ -238,7 +238,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
struct signal_frame_64 __user *sigframe;
unsigned long __user *fp, *uregs;

next_ip = regs->nip;
next_ip = perf_instruction_pointer(regs);
lr = regs->link;
sp = regs->gpr[1];
perf_callchain_store(entry, next_ip);
Expand Down Expand Up @@ -444,7 +444,7 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
long level = 0;
unsigned int __user *fp, *uregs;

next_ip = regs->nip;
next_ip = perf_instruction_pointer(regs);
lr = regs->link;
sp = regs->gpr[1];
perf_callchain_store(entry, next_ip);
Expand Down

0 comments on commit 6da7094

Please sign in to comment.