diff options
author | Vince Weaver <vincent.weaver@maine.edu> | 2014-06-15 02:06:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-06-19 13:37:51 -0400 |
commit | a10d60c08cc3bbea9195e2b36440f557373623eb (patch) | |
tree | 890b0d6fefaeda11289270d43bede967120d1d64 /arch/sh | |
parent | 97b1198fece06d495270222bcf5fde4c8cb0b5b0 (diff) |
sh, perf: Use common PMU interrupt disabled code
Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for
failing a sampling event when no PMU interrupt is available.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-sh@vger.kernel.org
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1406150205300.16738@vincent-weaver-1.umelst.maine.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/perf_event.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 02331672b6db..7cfd7f153966 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c | |||
@@ -129,14 +129,6 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
129 | return -ENODEV; | 129 | return -ENODEV; |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * All of the on-chip counters are "limited", in that they have | ||
133 | * no interrupts, and are therefore unable to do sampling without | ||
134 | * further work and timer assistance. | ||
135 | */ | ||
136 | if (hwc->sample_period) | ||
137 | return -EINVAL; | ||
138 | |||
139 | /* | ||
140 | * See if we need to reserve the counter. | 132 | * See if we need to reserve the counter. |
141 | * | 133 | * |
142 | * If no events are currently in use, then we have to take a | 134 | * If no events are currently in use, then we have to take a |
@@ -392,6 +384,13 @@ int register_sh_pmu(struct sh_pmu *_pmu) | |||
392 | 384 | ||
393 | pr_info("Performance Events: %s support registered\n", _pmu->name); | 385 | pr_info("Performance Events: %s support registered\n", _pmu->name); |
394 | 386 | ||
387 | /* | ||
388 | * All of the on-chip counters are "limited", in that they have | ||
389 | * no interrupts, and are therefore unable to do sampling without | ||
390 | * further work and timer assistance. | ||
391 | */ | ||
392 | pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; | ||
393 | |||
395 | WARN_ON(_pmu->num_events > MAX_HWEVENTS); | 394 | WARN_ON(_pmu->num_events > MAX_HWEVENTS); |
396 | 395 | ||
397 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); | 396 | perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW); |