Skip to content

Commit

Permalink
[PATCH] powerpc: Add oprofile calltrace support to all powerpc cpus
Browse files Browse the repository at this point in the history
Add calltrace support for other powerpc cpus. Tested on 7450.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Anton Blanchard authored and Paul Mackerras committed Mar 29, 2006
1 parent 6c6bd75 commit fa465f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/oprofile/op_model_7450.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ static void fsl7450_handle_interrupt(struct pt_regs *regs,
mtmsr(mfmsr() | MSR_PMM);

pc = mfspr(SPRN_SIAR);
is_kernel = (pc >= KERNELBASE);
is_kernel = is_kernel_addr(pc);

for (i = 0; i < NUM_CTRS; ++i) {
val = ctr_read(i);
if (val < 0) {
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]);
} else {
ctr_write(i, 0);
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/oprofile/op_model_fsl_booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
mtmsr(mfmsr() | MSR_PMM);

pc = regs->nip;
is_kernel = (pc >= KERNELBASE);
is_kernel = is_kernel_addr(pc);

for (i = 0; i < num_counters; ++i) {
val = ctr_read(i);
if (val < 0) {
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]);
} else {
ctr_write(i, 0);
Expand Down
5 changes: 4 additions & 1 deletion arch/powerpc/oprofile/op_model_rs64.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,21 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
struct op_counter_config *ctr)
{
unsigned int mmcr0;
int is_kernel;
int val;
int i;
unsigned long pc = mfspr(SPRN_SIAR);

is_kernel = is_kernel_addr(pc);

/* set the PMM bit (see comment below) */
mtmsrd(mfmsr() | MSR_PMM);

for (i = 0; i < num_counters; ++i) {
val = ctr_read(i);
if (val < 0) {
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]);
} else {
ctr_write(i, 0);
Expand Down

0 comments on commit fa465f8

Please sign in to comment.