Skip to content

Commit

Permalink
[POWERPC] Fix oprofile support for e500 in arch/powerpc
Browse files Browse the repository at this point in the history
Fixed a compile error in building the 85xx support with oprofile, and in
the process cleaned up some issues with the fsl_booke performance monitor
code.

* Reorganized FSL Book-E performance monitoring code so that the 7450
  wouldn't be built if the e500 was, and cleaned it up so it was more
  self-contained.

* Added a cpu_setup function for FSL Book-E.  The original
  cpu_setup function prototype had no arguments, assuming that
  the reg_setup function would copy the required information into
  variables which represented the registers.  This was silly for
  e500, since it has 1 register per counter (rather than 3 for
  all counters), so the code has been restructured to have
  cpu_setup take the current counter config array as an argument,
  with op_powerpc_setup() invoking op_powerpc_cpu_setup() through
  on_each_cpu(), and op_powerpc_cpu_setup() invoking the
  model-specific cpu_setup function with an argument.  The
  argument is ignored on all other platforms at present.

* Fixed a confusing line where a trinary operator only had two
  arguments

Signed-off-by: Andrew Fleming <afleming@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Andy Fleming authored and Paul Mackerras committed Nov 1, 2006
1 parent e0da0da commit dd6c89f
Show file tree
Hide file tree
Showing 11 changed files with 234 additions and 278 deletions.
1 change: 0 additions & 1 deletion arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o
obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
obj32-$(CONFIG_MODULES) += module_32.o
obj-$(CONFIG_E500) += perfmon_fsl_booke.o

ifeq ($(CONFIG_PPC_MERGE),y)

Expand Down
221 changes: 0 additions & 221 deletions arch/powerpc/kernel/perfmon_fsl_booke.c

This file was deleted.

2 changes: 1 addition & 1 deletion arch/powerpc/kernel/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int reserve_pmc_hardware(perf_irq_t new_perf_irq)
}

pmc_owner_caller = __builtin_return_address(0);
perf_irq = new_perf_irq ? : dummy_perf;
perf_irq = new_perf_irq ? new_perf_irq : dummy_perf;

out:
spin_unlock(&pmc_owner_lock);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/oprofile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
oprofile-$(CONFIG_PPC32) += op_model_7450.o
oprofile-$(CONFIG_6xx) += op_model_7450.o
10 changes: 8 additions & 2 deletions arch/powerpc/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ static void op_handle_interrupt(struct pt_regs *regs)
model->handle_interrupt(regs, ctr);
}

static void op_powerpc_cpu_setup(void *dummy)
{
model->cpu_setup(ctr);
}

static int op_powerpc_setup(void)
{
int err;
Expand All @@ -47,7 +52,7 @@ static int op_powerpc_setup(void)
model->reg_setup(ctr, &sys, model->num_counters);

/* Configure the registers on all cpus. */
on_each_cpu(model->cpu_setup, NULL, 0, 1);
on_each_cpu(op_powerpc_cpu_setup, NULL, 0, 1);

return 0;
}
Expand Down Expand Up @@ -142,7 +147,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
case PPC_OPROFILE_POWER4:
model = &op_model_power4;
break;
#else
#endif
#ifdef CONFIG_6xx
case PPC_OPROFILE_G4:
model = &op_model_7450;
break;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/oprofile/op_model_7450.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void pmc_stop_ctrs(void)

/* Configures the counters on this CPU based on the global
* settings */
static void fsl7450_cpu_setup(void *unused)
static void fsl7450_cpu_setup(struct op_counter_config *ctr)
{
/* freeze all counters */
pmc_stop_ctrs();
Expand Down
Loading

0 comments on commit dd6c89f

Please sign in to comment.