mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
s390/cpum_cf: Deny all sampling events by counter PMU
[ Upstream commit ce971233242b5391d99442271f3ca096fb49818d ]
Deny all sampling event by the CPUMF counter facility device driver
and return -ENOENT. This return value is used to try other PMUs.
Up to now events for type PERF_TYPE_HARDWARE were not tested for
sampling and returned later on -EOPNOTSUPP. This ends the search
for alternative PMUs. Change that behavior and try other PMUs
instead.
Fixes: 613a41b0d1 ("s390/cpum_cf: Reject request for sampling in event initialization")
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1262bda871
commit
d660c8d814
@@ -757,8 +757,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PERF_TYPE_HARDWARE:
|
case PERF_TYPE_HARDWARE:
|
||||||
if (is_sampling_event(event)) /* No sampling support */
|
|
||||||
return -ENOENT;
|
|
||||||
ev = attr->config;
|
ev = attr->config;
|
||||||
if (!attr->exclude_user && attr->exclude_kernel) {
|
if (!attr->exclude_user && attr->exclude_kernel) {
|
||||||
/*
|
/*
|
||||||
@@ -856,6 +854,8 @@ static int cpumf_pmu_event_init(struct perf_event *event)
|
|||||||
unsigned int type = event->attr.type;
|
unsigned int type = event->attr.type;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (is_sampling_event(event)) /* No sampling support */
|
||||||
|
return err;
|
||||||
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
|
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
|
||||||
err = __hw_perf_event_init(event, type);
|
err = __hw_perf_event_init(event, type);
|
||||||
else if (event->pmu->type == type)
|
else if (event->pmu->type == type)
|
||||||
|
|||||||
Reference in New Issue
Block a user