diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-01-30 17:51:56 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-02-14 15:55:15 +0100 |
commit | 151a0eb6c8e4398f76453c791d8fd8f8167a7517 (patch) | |
tree | ffa9855aaab15c18a8f3e606b817c0341ed35283 /arch/s390 | |
parent | bddb7ae217cea0ef722468fce823f9e19a69c561 (diff) | |
download | blackbird-op-linux-151a0eb6c8e4398f76453c791d8fd8f8167a7517.tar.gz blackbird-op-linux-151a0eb6c8e4398f76453c791d8fd8f8167a7517.zip |
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')
-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) if (ev >= PERF_CPUM_CF_MAX_CTR) return -EINVAL; - /* The CPU measurement counter facility does not have any interrupts - * to do sampling. Sampling must be provided by external means, - * for example, by timers. - */ - if (hwc->sample_period) - return -EINVAL; - /* Use the hardware perf event structure to store the counter number * in 'config' member and the counter set to which the counter belongs * 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) case PERF_TYPE_HARDWARE: case PERF_TYPE_HW_CACHE: case PERF_TYPE_RAW: + /* The CPU measurement counter facility does not have overflow + * interrupts to do sampling. Sampling must be provided by + * external means, for example, by timers. + */ + if (is_sampling_event(event)) + return -ENOENT; err = __hw_perf_event_init(event); break; default: |