aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-04-11 04:39:55 -0400
committerWill Deacon <will.deacon@arm.com>2017-04-11 11:29:54 -0400
commit45736a72fb79b204c1fbdb08a1e1a2aa52c7281a (patch)
treef5d754d6d02135ec024e9253fbf51d759c202edf /include/linux/perf
parente0013aed489e7ebbba59d7ada2ff5551ac4b61c6 (diff)
drivers/perf: arm_pmu: add ACPI framework
This patch adds framework code to handle parsing PMU data out of the MADT, sanity checking this, and managing the association of CPUs (and their interrupts) with appropriate logical PMUs. For the time being, we expect that only one PMU driver (PMUv3) will make use of this, and we simply pass in a single probe function. This is based on an earlier patch from Jeremy Linton. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Jeremy Linton <jeremy.linton@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/perf')
-rw-r--r--include/linux/perf/arm_pmu.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
index 25556ebb1c7b..1360dd6d5e61 100644
--- a/include/linux/perf/arm_pmu.h
+++ b/include/linux/perf/arm_pmu.h
@@ -117,6 +117,9 @@ struct arm_pmu {
117 struct notifier_block cpu_pm_nb; 117 struct notifier_block cpu_pm_nb;
118 /* the attr_groups array must be NULL-terminated */ 118 /* the attr_groups array must be NULL-terminated */
119 const struct attribute_group *attr_groups[ARMPMU_NR_ATTR_GROUPS + 1]; 119 const struct attribute_group *attr_groups[ARMPMU_NR_ATTR_GROUPS + 1];
120
121 /* Only to be used by ACPI probing code */
122 unsigned long acpi_cpuid;
120}; 123};
121 124
122#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) 125#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
@@ -159,12 +162,20 @@ int arm_pmu_device_probe(struct platform_device *pdev,
159 const struct of_device_id *of_table, 162 const struct of_device_id *of_table,
160 const struct pmu_probe_info *probe_table); 163 const struct pmu_probe_info *probe_table);
161 164
165#ifdef CONFIG_ACPI
166int arm_pmu_acpi_probe(armpmu_init_fn init_fn);
167#else
168static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }
169#endif
170
162/* Internal functions only for core arm_pmu code */ 171/* Internal functions only for core arm_pmu code */
163struct arm_pmu *armpmu_alloc(void); 172struct arm_pmu *armpmu_alloc(void);
164void armpmu_free(struct arm_pmu *pmu); 173void armpmu_free(struct arm_pmu *pmu);
165int armpmu_register(struct arm_pmu *pmu); 174int armpmu_register(struct arm_pmu *pmu);
166int armpmu_request_irqs(struct arm_pmu *armpmu); 175int armpmu_request_irqs(struct arm_pmu *armpmu);
167void armpmu_free_irqs(struct arm_pmu *armpmu); 176void armpmu_free_irqs(struct arm_pmu *armpmu);
177int armpmu_request_irq(struct arm_pmu *armpmu, int cpu);
178void armpmu_free_irq(struct arm_pmu *armpmu, int cpu);
168 179
169#define ARMV8_PMU_PDEV_NAME "armv8-pmu" 180#define ARMV8_PMU_PDEV_NAME "armv8-pmu"
170 181