diff options
author | Will Deacon <will.deacon@arm.com> | 2010-04-30 11:34:26 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-17 11:53:58 +0100 |
commit | 929f5199448a67d41bb249d58815ef77bcd53622 (patch) | |
tree | edb796c49205561ef98abb73f340e900225146dc /arch/arm/kernel/perf_event.c | |
parent | 49e6a32f2f0876b6267584d9c7e0e213bca6e2b8 (diff) | |
download | kernel_samsung_espresso10-929f5199448a67d41bb249d58815ef77bcd53622.zip kernel_samsung_espresso10-929f5199448a67d41bb249d58815ef77bcd53622.tar.gz kernel_samsung_espresso10-929f5199448a67d41bb249d58815ef77bcd53622.tar.bz2 |
ARM: 6071/1: perf-events: allow modules to query the number of hardware counters
For OProfile to initialise oprofilefs correctly, it needs to know
the number of counters it can represent.
This patch adds a function to the ARM perf-events backend to return
the number of hardware counters available for the current PMU.
Cc: Jamie Iles <jamie.iles@picochip.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r-- | arch/arm/kernel/perf_event.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 381f121..c457686 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -111,6 +111,18 @@ armpmu_get_pmu_id(void) } EXPORT_SYMBOL_GPL(armpmu_get_pmu_id); +int +armpmu_get_max_events(void) +{ + int max_events = 0; + + if (armpmu != NULL) + max_events = armpmu->num_events; + + return max_events; +} +EXPORT_SYMBOL_GPL(armpmu_get_max_events); + #define HW_OP_UNSUPPORTED 0xFFFF #define C(_x) \ |