summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2011-06-24 11:30:59 +0100
committerWill Deacon <will.deacon@arm.com>2011-08-31 10:50:11 +0100
commit3fc2c83087717dc88003428245d97b9d432fff2d (patch)
tree5dc3f1633c40df8a0b52f046754013355a9f65c1 /arch/arm/kernel/perf_event.c
parent8a16b34e21199eb5fcf2c5050d3bc414fc5d6563 (diff)
downloadop-kernel-dev-3fc2c83087717dc88003428245d97b9d432fff2d.zip
op-kernel-dev-3fc2c83087717dc88003428245d97b9d432fff2d.tar.gz
ARM: perf: remove event limit from pmu_hw_events
Currently the event accounting data in pmu_hw_events is stored in fixed-sized arrays within the structure. This patch refactors the accounting data to allow any number of events to be managed. 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>
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 7f31eff..e1db555 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -42,13 +42,13 @@ struct cpu_hw_events {
/*
* The events that are active on the CPU for the given index.
*/
- struct perf_event *events[ARMPMU_MAX_HWEVENTS];
+ struct perf_event **events;
/*
* A 1 bit for an index indicates that the counter is being used for
* an event. A 0 means that the counter can be used.
*/
- unsigned long used_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
+ unsigned long *used_mask;
/*
* Hardware lock to serialize accesses to PMU registers. Needed for the
@@ -56,6 +56,9 @@ struct cpu_hw_events {
*/
raw_spinlock_t pmu_lock;
};
+
+static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events);
+static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask);
static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
struct arm_pmu {
@@ -714,6 +717,8 @@ static void __init cpu_pmu_init(struct arm_pmu *armpmu)
int cpu;
for_each_possible_cpu(cpu) {
struct cpu_hw_events *events = &per_cpu(cpu_hw_events, cpu);
+ events->events = per_cpu(hw_events, cpu);
+ events->used_mask = per_cpu(used_mask, cpu);
raw_spin_lock_init(&events->pmu_lock);
}
armpmu->get_hw_events = armpmu_get_cpu_events;
OpenPOWER on IntegriCloud