summaryrefslogtreecommitdiffstats
path: root/drivers/perf/arm_pmu.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2018-10-05 13:24:36 +0100
committerWill Deacon <will.deacon@arm.com>2018-10-12 15:25:17 +0100
commitca2b497253ad01c80061a1f3ee9eb91b5d54a849 (patch)
tree06b96eee97a7f40173136b35f8b3ff945ae5925f /drivers/perf/arm_pmu.c
parentd91680e687f47984ffd3200c8e5d587903e7bd11 (diff)
downloadtalos-op-linux-ca2b497253ad01c80061a1f3ee9eb91b5d54a849.tar.gz
talos-op-linux-ca2b497253ad01c80061a1f3ee9eb91b5d54a849.zip
arm64: perf: Reject stand-alone CHAIN events for PMUv3
It doesn't make sense for a perf event to be configured as a CHAIN event in isolation, so extend the arm_pmu structure with a ->filter_match() function to allow the backend PMU implementation to reject CHAIN events early. Cc: <stable@vger.kernel.org> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf/arm_pmu.c')
-rw-r--r--drivers/perf/arm_pmu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 7f01f6f60b87..d0b7dd8fb184 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -485,7 +485,13 @@ static int armpmu_filter_match(struct perf_event *event)
{
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
unsigned int cpu = smp_processor_id();
- return cpumask_test_cpu(cpu, &armpmu->supported_cpus);
+ int ret;
+
+ ret = cpumask_test_cpu(cpu, &armpmu->supported_cpus);
+ if (ret && armpmu->filter_match)
+ return armpmu->filter_match(event);
+
+ return ret;
}
static ssize_t armpmu_cpumask_show(struct device *dev,
OpenPOWER on IntegriCloud