ARM: perf: indirect access to cpu_hw_events
authorMark Rutland <mark.rutland@arm.com>
Wed, 4 May 2011 08:23:51 +0000 (09:23 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 31 Aug 2011 09:50:05 +0000 (10:50 +0100)
commit92f701e1f429e007f9619469d548022061c41ecc
treece70ecb1b103c52f7ddee02a935f940a59c7d76e
parenta9356a04fab912289b886824cb4b1d461987a910
ARM: perf: indirect access to cpu_hw_events

Currently, cpu_hw_events is a global per-CPU variable. To enable
support for multiple PMUs, there needs to be a mapping from an instance
of arm_pmu to its cpu_hw_events. Additionally, as system PMUs are not
CPU-affine, they should not have this stored per-CPU.

This patch moves access to the hardware events data behind an accessor
function (arm_pmu::get_hw_events). This allows each instance to have
its own hardware event data, which can be stored per-CPU or globally as
required.

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