diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-01-30 11:51:56 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-02-14 09:55:15 -0500 |
commit | 151a0eb6c8e4398f76453c791d8fd8f8167a7517 (patch) | |
tree | ffa9855aaab15c18a8f3e606b817c0341ed35283 /arch/s390/kernel/perf_cpum_cf.c | |
parent | bddb7ae217cea0ef722468fce823f9e19a69c561 (diff) |
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>
Diffstat (limited to 'arch/s390/kernel/perf_cpum_cf.c')
-rw-r--r-- | arch/s390/kernel/perf_cpum_cf.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 86ec7447e1f5..390d9ae57bb2 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c | |||
@@ -367,13 +367,6 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
367 | if (ev >= PERF_CPUM_CF_MAX_CTR) | 367 | if (ev >= PERF_CPUM_CF_MAX_CTR) |
368 | return -EINVAL; | 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 | /* Use the hardware perf event structure to store the counter number | 370 | /* Use the hardware perf event structure to store the counter number |
378 | * in 'config' member and the counter set to which the counter belongs | 371 | * in 'config' member and the counter set to which the counter belongs |
379 | * in the 'config_base'. The counter set (config_base) is then used | 372 | * in the 'config_base'. The counter set (config_base) is then used |
@@ -418,6 +411,12 @@ static int cpumf_pmu_event_init(struct perf_event *event) | |||
418 | case PERF_TYPE_HARDWARE: | 411 | case PERF_TYPE_HARDWARE: |
419 | case PERF_TYPE_HW_CACHE: | 412 | case PERF_TYPE_HW_CACHE: |
420 | case PERF_TYPE_RAW: | 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 | err = __hw_perf_event_init(event); | 420 | err = __hw_perf_event_init(event); |
422 | break; | 421 | break; |
423 | default: | 422 | default: |