diff options
author | James Clark <james.clark@arm.com> | 2023-12-11 16:13:21 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-12-12 09:46:22 +0000 |
commit | 186c91aaf54989a9c74869dcc6ba031313d8e2b8 (patch) | |
tree | f37e4c8e88c0e4dae71050917ffc2bae2948deca /drivers/perf/apple_m1_cpu_pmu.c | |
parent | c7b98bf0fc79bd2d91f6ef84e07b5f648d43c13e (diff) | |
download | lwn-186c91aaf54989a9c74869dcc6ba031313d8e2b8.tar.gz lwn-186c91aaf54989a9c74869dcc6ba031313d8e2b8.zip |
arm: pmu: Move error message and -EOPNOTSUPP to individual PMUs
-EPERM or -EINVAL always get converted to -EOPNOTSUPP, so replace them.
This will allow __hw_perf_event_init() to return a different code or not
print that particular message for a different error in the next commit.
Signed-off-by: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20231211161331.1277825-10-james.clark@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf/apple_m1_cpu_pmu.c')
-rw-r--r-- | drivers/perf/apple_m1_cpu_pmu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c index cd2de44b61b9..f322e5ca1114 100644 --- a/drivers/perf/apple_m1_cpu_pmu.c +++ b/drivers/perf/apple_m1_cpu_pmu.c @@ -524,8 +524,10 @@ static int m1_pmu_set_event_filter(struct hw_perf_event *event, { unsigned long config_base = 0; - if (!attr->exclude_guest) - return -EINVAL; + if (!attr->exclude_guest) { + pr_debug("ARM performance counters do not support mode exclusion\n"); + return -EOPNOTSUPP; + } if (!attr->exclude_kernel) config_base |= M1_PMU_CFG_COUNT_KERNEL; if (!attr->exclude_user) |