Skip to content

Commit d660c8d

Browse files
Thomas Richtergregkh
authored andcommitted
s390/cpum_cf: Deny all sampling events by counter PMU
[ Upstream commit ce97123 ] 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: 613a41b ("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>
1 parent 1262bda commit d660c8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
757757
break;
758758

759759
case PERF_TYPE_HARDWARE:
760-
if (is_sampling_event(event)) /* No sampling support */
761-
return -ENOENT;
762760
ev = attr->config;
763761
if (!attr->exclude_user && attr->exclude_kernel) {
764762
/*
@@ -856,6 +854,8 @@ static int cpumf_pmu_event_init(struct perf_event *event)
856854
unsigned int type = event->attr.type;
857855
int err;
858856

857+
if (is_sampling_event(event)) /* No sampling support */
858+
return err;
859859
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
860860
err = __hw_perf_event_init(event, type);
861861
else if (event->pmu->type == type)

0 commit comments

Comments
 (0)