Skip to content

Commit

Permalink
s390/perf: cpum_cf: fallback to software sampling events
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hendrik Brueckner authored and Martin Schwidefsky committed Feb 14, 2013
1 parent bddb7ae commit 151a0eb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions arch/s390/kernel/perf_cpum_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 151a0eb

Please sign in to comment.