Commit 151a0eb6c8e4398f76453c791d8fd8f8167a7517
Committed by
Martin Schwidefsky
1 parent
bddb7ae217
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
s390/perf: cpum_cf: fallback to software sampling events
The CPU-measurement counter facility does not support sampling events and returns -EINVAL in that case. This return code lets the perf tool fail. To fall back to software sampling events, return -ENOENT instead. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 1 changed file with 6 additions and 7 deletions Side-by-side Diff
arch/s390/kernel/perf_cpum_cf.c
... | ... | @@ -367,13 +367,6 @@ |
367 | 367 | if (ev >= PERF_CPUM_CF_MAX_CTR) |
368 | 368 | return -EINVAL; |
369 | 369 | |
370 | - /* The CPU measurement counter facility does not have any interrupts | |
371 | - * to do sampling. Sampling must be provided by external means, | |
372 | - * for example, by timers. | |
373 | - */ | |
374 | - if (hwc->sample_period) | |
375 | - return -EINVAL; | |
376 | - | |
377 | 370 | /* Use the hardware perf event structure to store the counter number |
378 | 371 | * in 'config' member and the counter set to which the counter belongs |
379 | 372 | * in the 'config_base'. The counter set (config_base) is then used |
... | ... | @@ -418,6 +411,12 @@ |
418 | 411 | case PERF_TYPE_HARDWARE: |
419 | 412 | case PERF_TYPE_HW_CACHE: |
420 | 413 | case PERF_TYPE_RAW: |
414 | + /* The CPU measurement counter facility does not have overflow | |
415 | + * interrupts to do sampling. Sampling must be provided by | |
416 | + * external means, for example, by timers. | |
417 | + */ | |
418 | + if (is_sampling_event(event)) | |
419 | + return -ENOENT; | |
421 | 420 | err = __hw_perf_event_init(event); |
422 | 421 | break; |
423 | 422 | default: |