diff options
author | Paul Mackerras <paulus@samba.org> | 2009-06-17 07:50:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-18 05:11:44 -0400 |
commit | 105988c015943e77092a6568bc5fb7e386df6ccd (patch) | |
tree | bd352fe5e68a66de2e08a8b91c8f8cccf422f346 /arch/powerpc/platforms | |
parent | a73c7d84a1975b44c0ebd03c2dec288af1426349 (diff) |
perf_counter: powerpc: Enable use of software counters on 32-bit powerpc
This enables the perf_counter subsystem on 32-bit powerpc. Since we
don't have any support for hardware counters on 32-bit powerpc yet,
only software counters can be used.
Besides selecting HAVE_PERF_COUNTERS for 32-bit powerpc as well as
64-bit, the main thing this does is add an implementation of
set_perf_counter_pending(). This needs to arrange for
perf_counter_do_pending() to be called when interrupts are enabled.
Rather than add code to local_irq_restore as 64-bit does, the 32-bit
set_perf_counter_pending() generates an interrupt by setting the
decrementer to 1 so that a decrementer interrupt will become pending
in 1 or 2 timebase ticks (if a decrementer interrupt isn't already
pending). When interrupts are enabled, timer_interrupt() will be
called, and some new code in there calls perf_counter_do_pending().
We use a per-cpu array of flags to indicate whether we need to call
perf_counter_do_pending() or not.
This introduces a couple of new Kconfig symbols: PPC_HAVE_PMU_SUPPORT,
which is selected by processor families for which we have hardware PMU
support (currently only PPC64), and PPC_PERF_CTRS, which enables the
powerpc-specific perf_counter back-end.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linuxppc-dev@ozlabs.org
Cc: benh@kernel.crashing.org
LKML-Reference: <19000.55404.103840.393470@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index cca6b4fc719a..dd9f3ec5ee30 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -1,7 +1,7 @@ | |||
1 | config PPC64 | 1 | config PPC64 |
2 | bool "64-bit kernel" | 2 | bool "64-bit kernel" |
3 | default n | 3 | default n |
4 | select HAVE_PERF_COUNTERS | 4 | select PPC_HAVE_PMU_SUPPORT |
5 | help | 5 | help |
6 | This option selects whether a 32-bit or a 64-bit kernel | 6 | This option selects whether a 32-bit or a 64-bit kernel |
7 | will be built. | 7 | will be built. |
@@ -243,6 +243,15 @@ config VIRT_CPU_ACCOUNTING | |||
243 | 243 | ||
244 | If in doubt, say Y here. | 244 | If in doubt, say Y here. |
245 | 245 | ||
246 | config PPC_HAVE_PMU_SUPPORT | ||
247 | bool | ||
248 | |||
249 | config PPC_PERF_CTRS | ||
250 | def_bool y | ||
251 | depends on PERF_COUNTERS && PPC_HAVE_PMU_SUPPORT | ||
252 | help | ||
253 | This enables the powerpc-specific perf_counter back-end. | ||
254 | |||
246 | config SMP | 255 | config SMP |
247 | depends on PPC_STD_MMU || FSL_BOOKE | 256 | depends on PPC_STD_MMU || FSL_BOOKE |
248 | bool "Symmetric multi-processing support" | 257 | bool "Symmetric multi-processing support" |