diff options
author | Will Deacon <will.deacon@arm.com> | 2012-07-29 07:36:28 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2012-08-23 06:35:52 -0400 |
commit | 6dbc00297095122ea89e016ce6affad0b7c0ddac (patch) | |
tree | f3c01a92818dd1a8e9cf9cd9a52cae8229332c55 /arch/arm/include | |
parent | 04236f9fe07462849215c67cae6147661368bfad (diff) |
ARM: perf: prepare for moving CPU PMU code into separate file
The CPU PMU code is tightly coupled with generic ARM PMU handling code.
This makes it cumbersome when trying to add support for other ARM PMUs
(e.g. interconnect, L2 cache controller, bus) as the generic parts of
the code are not readily reusable.
This patch cleans up perf_event.c so that reusable code is exposed via
header files to other potential PMU drivers. The CPU code is
consistently named to identify it as such and also to prepare for moving
it into a separate file.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/perf_event.h | 9 | ||||
-rw-r--r-- | arch/arm/include/asm/pmu.h | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h index e074948d8143..625cd621a436 100644 --- a/arch/arm/include/asm/perf_event.h +++ b/arch/arm/include/asm/perf_event.h | |||
@@ -12,6 +12,13 @@ | |||
12 | #ifndef __ARM_PERF_EVENT_H__ | 12 | #ifndef __ARM_PERF_EVENT_H__ |
13 | #define __ARM_PERF_EVENT_H__ | 13 | #define __ARM_PERF_EVENT_H__ |
14 | 14 | ||
15 | /* Nothing to see here... */ | 15 | /* |
16 | * The ARMv7 CPU PMU supports up to 32 event counters. | ||
17 | */ | ||
18 | #define ARMPMU_MAX_HWEVENTS 32 | ||
19 | |||
20 | #define HW_OP_UNSUPPORTED 0xFFFF | ||
21 | #define C(_x) PERF_COUNT_HW_CACHE_##_x | ||
22 | #define CACHE_OP_UNSUPPORTED 0xFFFF | ||
16 | 23 | ||
17 | #endif /* __ARM_PERF_EVENT_H__ */ | 24 | #endif /* __ARM_PERF_EVENT_H__ */ |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index fbec73a0ee76..a993ad676047 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
@@ -89,7 +89,9 @@ struct arm_pmu { | |||
89 | 89 | ||
90 | #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) | 90 | #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) |
91 | 91 | ||
92 | int __init armpmu_register(struct arm_pmu *armpmu, char *name, int type); | 92 | extern const struct dev_pm_ops armpmu_dev_pm_ops; |
93 | |||
94 | int armpmu_register(struct arm_pmu *armpmu, char *name, int type); | ||
93 | 95 | ||
94 | u64 armpmu_event_update(struct perf_event *event, | 96 | u64 armpmu_event_update(struct perf_event *event, |
95 | struct hw_perf_event *hwc, | 97 | struct hw_perf_event *hwc, |
@@ -99,6 +101,13 @@ int armpmu_event_set_period(struct perf_event *event, | |||
99 | struct hw_perf_event *hwc, | 101 | struct hw_perf_event *hwc, |
100 | int idx); | 102 | int idx); |
101 | 103 | ||
104 | int armpmu_map_event(struct perf_event *event, | ||
105 | const unsigned (*event_map)[PERF_COUNT_HW_MAX], | ||
106 | const unsigned (*cache_map)[PERF_COUNT_HW_CACHE_MAX] | ||
107 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
108 | [PERF_COUNT_HW_CACHE_RESULT_MAX], | ||
109 | u32 raw_event_mask); | ||
110 | |||
102 | #endif /* CONFIG_HW_PERF_EVENTS */ | 111 | #endif /* CONFIG_HW_PERF_EVENTS */ |
103 | 112 | ||
104 | #endif /* __ARM_PMU_H__ */ | 113 | #endif /* __ARM_PMU_H__ */ |