arm: perf: make PMU probing data-driven
authorMark Rutland <mark.rutland@arm.com>
Fri, 23 May 2014 17:11:14 +0000 (18:11 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 30 Oct 2014 12:16:59 +0000 (12:16 +0000)
commit548a86cae4858433cab7e101bca2c6856ab55887
tree91ec901f7e5bac7fa7645e809b2610cca195d0cc
parent0f2a21018a71d8d3fec507f9c55ae8ed03ab9321
arm: perf: make PMU probing data-driven

The current PMU probing logic consists of a single switch statement,
which means that the core arm_pmu core in perf_event_cpu.c needs to know
about every CPU PMU variant supported by a driver using the arm_pmu
framework. This makes it rather difficult to decouple the drivers from
the (otherwise generic) probing code.

The patch refactors that switch statement to a table-driven lookup,
separating the logic and knowledge (in the form of the table). Later
patches will split the table across the relevant PMU drivers, which can
pass their tables to the generic probing function.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/pmu.h
arch/arm/kernel/perf_event_cpu.c