Skip to content

Commit ce97123

Browse files
Thomas RichterAlexander Gordeev
authored andcommitted
s390/cpum_cf: Deny all sampling events by counter PMU
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 <[email protected]> Signed-off-by: Thomas Richter <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 85941af commit ce97123

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
@@ -760,8 +760,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
760760
break;
761761

762762
case PERF_TYPE_HARDWARE:
763-
if (is_sampling_event(event)) /* No sampling support */
764-
return -ENOENT;
765763
ev = attr->config;
766764
if (!attr->exclude_user && attr->exclude_kernel) {
767765
/*
@@ -859,6 +857,8 @@ static int cpumf_pmu_event_init(struct perf_event *event)
859857
unsigned int type = event->attr.type;
860858
int err = -ENOENT;
861859

860+
if (is_sampling_event(event)) /* No sampling support */
861+
return err;
862862
if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_RAW)
863863
err = __hw_perf_event_init(event, type);
864864
else if (event->pmu->type == type)

0 commit comments

Comments
 (0)