Commit e83d710f authored by Greg Banks's avatar Greg Banks Committed by Linus Torvalds

[PATCH] oprofile: update ppc for api changes

oprofile ppc64 arch updates, including some internal API changes.
Signed-off-by: default avatarJohn Levon <levon@movementarian.org>
Signed-off-by: default avatarGreg Banks <gnb@melbourne.sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f03b14cd
...@@ -125,16 +125,7 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root) ...@@ -125,16 +125,7 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
return 0; return 0;
} }
static struct oprofile_operations oprof_ppc64_ops = { void __init oprofile_arch_init(struct oprofile_operations *ops)
.create_files = op_ppc64_create_files,
.setup = op_ppc64_setup,
.shutdown = op_ppc64_shutdown,
.start = op_ppc64_start,
.stop = op_ppc64_stop,
.cpu_type = NULL /* To be filled in below. */
};
int __init oprofile_arch_init(struct oprofile_operations **ops)
{ {
unsigned int pvr; unsigned int pvr;
...@@ -145,7 +136,7 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) ...@@ -145,7 +136,7 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
case PV_630p: case PV_630p:
model = &op_model_rs64; model = &op_model_rs64;
model->num_counters = 8; model->num_counters = 8;
oprof_ppc64_ops.cpu_type = "ppc64/power3"; ops->cpu_type = "ppc64/power3";
break; break;
case PV_NORTHSTAR: case PV_NORTHSTAR:
...@@ -154,40 +145,42 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) ...@@ -154,40 +145,42 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
case PV_SSTAR: case PV_SSTAR:
model = &op_model_rs64; model = &op_model_rs64;
model->num_counters = 8; model->num_counters = 8;
oprof_ppc64_ops.cpu_type = "ppc64/rs64"; ops->cpu_type = "ppc64/rs64";
break; break;
case PV_POWER4: case PV_POWER4:
case PV_POWER4p: case PV_POWER4p:
model = &op_model_power4; model = &op_model_power4;
model->num_counters = 8; model->num_counters = 8;
oprof_ppc64_ops.cpu_type = "ppc64/power4"; ops->cpu_type = "ppc64/power4";
break; break;
case PV_970: case PV_970:
case PV_970FX: case PV_970FX:
model = &op_model_power4; model = &op_model_power4;
model->num_counters = 8; model->num_counters = 8;
oprof_ppc64_ops.cpu_type = "ppc64/970"; ops->cpu_type = "ppc64/970";
break; break;
case PV_POWER5: case PV_POWER5:
case PV_POWER5p: case PV_POWER5p:
model = &op_model_power4; model = &op_model_power4;
model->num_counters = 6; model->num_counters = 6;
oprof_ppc64_ops.cpu_type = "ppc64/power5"; ops->cpu_type = "ppc64/power5";
break; break;
default: default:
return -ENODEV; return;
} }
*ops = &oprof_ppc64_ops; ops->create_files = op_ppc64_create_files;
ops->setup = op_ppc64_setup;
ops->shutdown = op_ppc64_shutdown;
ops->start = op_ppc64_start;
ops->stop = op_ppc64_stop;
printk(KERN_INFO "oprofile: using %s performance monitoring.\n", printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
oprof_ppc64_ops.cpu_type); ops->cpu_type);
return 0;
} }
void oprofile_arch_exit(void) void oprofile_arch_exit(void)
......
...@@ -264,7 +264,6 @@ static void power4_handle_interrupt(struct pt_regs *regs, ...@@ -264,7 +264,6 @@ static void power4_handle_interrupt(struct pt_regs *regs,
int is_kernel; int is_kernel;
int val; int val;
int i; int i;
unsigned int cpu = smp_processor_id();
unsigned int mmcr0; unsigned int mmcr0;
pc = get_pc(regs); pc = get_pc(regs);
...@@ -277,7 +276,7 @@ static void power4_handle_interrupt(struct pt_regs *regs, ...@@ -277,7 +276,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
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_sample(pc, is_kernel, i, cpu); oprofile_add_pc(pc, is_kernel, i);
ctr_write(i, reset_value[i]); ctr_write(i, reset_value[i]);
} else { } else {
ctr_write(i, 0); ctr_write(i, 0);
......
...@@ -180,7 +180,6 @@ static void rs64_handle_interrupt(struct pt_regs *regs, ...@@ -180,7 +180,6 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
int i; int i;
unsigned long pc = mfspr(SPRN_SIAR); unsigned long pc = mfspr(SPRN_SIAR);
int is_kernel = (pc >= KERNELBASE); int is_kernel = (pc >= KERNELBASE);
unsigned int cpu = smp_processor_id();
/* set the PMM bit (see comment below) */ /* set the PMM bit (see comment below) */
mtmsrd(mfmsr() | MSR_PMM); mtmsrd(mfmsr() | MSR_PMM);
...@@ -189,7 +188,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs, ...@@ -189,7 +188,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_sample(pc, is_kernel, i, cpu); oprofile_add_pc(pc, is_kernel, i);
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