aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/pmu.h
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2012-12-12 18:13:44 +0000
committerAndrey Konovalov <andrey.konovalov@linaro.org>2013-05-25 13:21:44 +0400
commitc9547c4e2d1b1348ed74f62f607b8d913e9e6667 (patch)
tree0f84be1e9ce8270826e8260f0f010165d7093819 /arch/arm/include/asm/pmu.h
parente7a123aeb0117cc41f5dfde53d3554308a1d592e (diff)
ARM: perf: [WIP] Add register emulation for offline ARMv7 PMUs
This patch aims to provide basic register file functionality for ARMv7 CPU PMUs while the PMU is offline. It is incomplete and lacks the necessary plumbing to actually make use of this, but the extra code needed is not expected to be large or complex. Save/restore are ported over the register emulation framework, since the offline logical state of the CPU matches exactly what needs to be captures in save/restore. Because this patch is rather invasive, it should be dropped in the future in favour of higher-level abstraction before merging upstream. Signed-off-by: Dave Martin <dave.martin@linaro.org>
Diffstat (limited to 'arch/arm/include/asm/pmu.h')
-rw-r--r--arch/arm/include/asm/pmu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index b42e63fbb21..cb500631c00 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -75,6 +75,7 @@ struct cpupmu_regs {
struct arm_cpu_pmu {
bool valid;
+ bool active;
u32 midr_match;
u32 midr_mask;
@@ -83,6 +84,8 @@ struct arm_cpu_pmu {
unsigned long used_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)];
struct pmu_hw_events cpu_hw_events;
struct cpupmu_regs cpu_pmu_regs;
+
+ void *logical_state;
};
struct arm_pmu {
@@ -122,6 +125,8 @@ struct arm_pmu {
#define for_each_pmu(pmu, head) list_for_each_entry(pmu, head, class_pmus_list)
+#define to_this_cpu_pmu(arm_pmu) this_cpu_ptr((arm_pmu)->cpu_pmus)
+
extern const struct dev_pm_ops armpmu_dev_pm_ops;
int armpmu_register(struct arm_pmu *armpmu, int type);