Commit fa465f8c authored by Anton Blanchard's avatar Anton Blanchard Committed by Paul Mackerras

[PATCH] powerpc: Add oprofile calltrace support to all powerpc cpus

Add calltrace support for other powerpc cpus. Tested on 7450.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 6c6bd754
...@@ -176,13 +176,13 @@ static void fsl7450_handle_interrupt(struct pt_regs *regs, ...@@ -176,13 +176,13 @@ static void fsl7450_handle_interrupt(struct pt_regs *regs,
mtmsr(mfmsr() | MSR_PMM); mtmsr(mfmsr() | MSR_PMM);
pc = mfspr(SPRN_SIAR); pc = mfspr(SPRN_SIAR);
is_kernel = (pc >= KERNELBASE); is_kernel = is_kernel_addr(pc);
for (i = 0; i < NUM_CTRS; ++i) { for (i = 0; i < NUM_CTRS; ++i) {
val = ctr_read(i); val = ctr_read(i);
if (val < 0) { if (val < 0) {
if (oprofile_running && ctr[i].enabled) { if (oprofile_running && ctr[i].enabled) {
oprofile_add_pc(pc, is_kernel, i); oprofile_add_ext_sample(pc, regs, i, is_kernel);
ctr_write(i, reset_value[i]); ctr_write(i, reset_value[i]);
} else { } else {
ctr_write(i, 0); ctr_write(i, 0);
......
...@@ -154,13 +154,13 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs, ...@@ -154,13 +154,13 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
mtmsr(mfmsr() | MSR_PMM); mtmsr(mfmsr() | MSR_PMM);
pc = regs->nip; pc = regs->nip;
is_kernel = (pc >= KERNELBASE); is_kernel = is_kernel_addr(pc);
for (i = 0; i < num_counters; ++i) { for (i = 0; i < num_counters; ++i) {
val = ctr_read(i); val = ctr_read(i);
if (val < 0) { if (val < 0) {
if (oprofile_running && ctr[i].enabled) { if (oprofile_running && ctr[i].enabled) {
oprofile_add_pc(pc, is_kernel, i); oprofile_add_ext_sample(pc, regs, i, is_kernel);
ctr_write(i, reset_value[i]); ctr_write(i, reset_value[i]);
} else { } else {
ctr_write(i, 0); ctr_write(i, 0);
......
...@@ -175,10 +175,13 @@ static void rs64_handle_interrupt(struct pt_regs *regs, ...@@ -175,10 +175,13 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
struct op_counter_config *ctr) struct op_counter_config *ctr)
{ {
unsigned int mmcr0; unsigned int mmcr0;
int is_kernel;
int val; int val;
int i; int i;
unsigned long pc = mfspr(SPRN_SIAR); unsigned long pc = mfspr(SPRN_SIAR);
is_kernel = is_kernel_addr(pc);
/* set the PMM bit (see comment below) */ /* set the PMM bit (see comment below) */
mtmsrd(mfmsr() | MSR_PMM); mtmsrd(mfmsr() | MSR_PMM);
...@@ -186,7 +189,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs, ...@@ -186,7 +189,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
val = ctr_read(i); val = ctr_read(i);
if (val < 0) { if (val < 0) {
if (ctr[i].enabled) { if (ctr[i].enabled) {
oprofile_add_pc(pc, is_kernel_addr(pc), i); oprofile_add_ext_sample(pc, regs, i, is_kernel);
ctr_write(i, reset_value[i]); ctr_write(i, reset_value[i]);
} else { } else {
ctr_write(i, 0); ctr_write(i, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment