Commit 7c7a83ea authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc32: Fix pmac kernel build with oprofile

The recent oprofile changes for Motorola e500 broke oprofile for other
CPUs.  This patch fixes the build.

Proper support for the G3/G4 PMCs would be interesting, and making sure the
basic interrupt PC sampling still works on CPUs that don't have supported
PMCs too...
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5eb78e8e
...@@ -6,4 +6,9 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \ ...@@ -6,4 +6,9 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
oprofilefs.o oprofile_stats.o \ oprofilefs.o oprofile_stats.o \
timer_int.o ) timer_int.o )
oprofile-y := $(DRIVER_OBJS) common.o op_model_fsl_booke.o oprofile-y := $(DRIVER_OBJS) common.o
ifeq ($(CONFIG_FSL_BOOKE),y)
oprofile-y += op_model_fsl_booke.o
endif
...@@ -124,7 +124,7 @@ static struct oprofile_operations oprof_ppc32_ops = { ...@@ -124,7 +124,7 @@ static struct oprofile_operations oprof_ppc32_ops = {
.cpu_type = NULL /* To be filled in below. */ .cpu_type = NULL /* To be filled in below. */
}; };
int __init oprofile_arch_init(struct oprofile_operations **ops) void __init oprofile_arch_init(struct oprofile_operations *ops)
{ {
char *name; char *name;
int cpu_id = smp_processor_id(); int cpu_id = smp_processor_id();
...@@ -133,13 +133,13 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) ...@@ -133,13 +133,13 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
model = &op_model_fsl_booke; model = &op_model_fsl_booke;
#else #else
printk(KERN_ERR "oprofile enabled on unsupported processor!\n"); printk(KERN_ERR "oprofile enabled on unsupported processor!\n");
return -ENODEV; return;
#endif #endif
name = kmalloc(32, GFP_KERNEL); name = kmalloc(32, GFP_KERNEL);
if (NULL == name) if (NULL == name)
return -ENOMEM; return;
sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name); sprintf(name, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
...@@ -147,12 +147,10 @@ int __init oprofile_arch_init(struct oprofile_operations **ops) ...@@ -147,12 +147,10 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs; model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
*ops = &oprof_ppc32_ops; *ops = oprof_ppc32_ops;
printk(KERN_INFO "oprofile: using %s performance monitoring.\n", printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
oprof_ppc32_ops.cpu_type); oprof_ppc32_ops.cpu_type);
return 0;
} }
void oprofile_arch_exit(void) void oprofile_arch_exit(void)
......
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