ARM: perf: add support for multiple PMUs
authorMark Rutland <mark.rutland@arm.com>
Thu, 28 Apr 2011 15:27:54 +0000 (16:27 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 31 Aug 2011 09:50:10 +0000 (10:50 +0100)
commit8a16b34e21199eb5fcf2c5050d3bc414fc5d6563
tree40a6c739285b7c1f389bf5597d9ae746080c0736
parente1f431b57ef9e4a68281540933fa74865cbb7a74
ARM: perf: add support for multiple PMUs

Currently, a single static instance of struct pmu is used when
registering an ARM PMU with the main perf subsystem. This limits
the ARM perf code to supporting a single PMU.

This patch replaces the static struct pmu instance with a member
variable on struct arm_pmu. This provides bidirectional mapping
between the two structs, and therefore allows for support of multiple
PMUs. The function 'to_arm_pmu' is provided for convenience.

PMU-generic functions are also updated to use the new mapping, and
PMU-generic initialisation of the member variables is moved into a new
function: armpmu_init.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Ashwin Chaugule <ashwinc@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c