diff options
author | Mark Rutland <mark.rutland@arm.com> | 2017-04-11 09:39:44 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-04-11 16:29:53 +0100 |
commit | a9e469d1c89b5e9890859b5f001601498549577d (patch) | |
tree | 7f3ebaa6a184807753b7ed09b0e7c217e0b5fa3b /drivers/perf/arm_pmu.c | |
parent | 3071f13d75f627ed8648535815a0506d50cbc6ed (diff) | |
download | linux-a9e469d1c89b5e9890859b5f001601498549577d.tar.gz linux-a9e469d1c89b5e9890859b5f001601498549577d.tar.bz2 linux-a9e469d1c89b5e9890859b5f001601498549577d.zip |
drivers/perf: arm_pmu: remove pointless PMU disabling
We currently disable the PMU temporarily in armpmu_add(). We may have
required this historically, but the perf core always disables an event's
PMU when calling event::pmu::add(), so this is not necessary.
We don't do similarly in armpmu_del(), or elsewhere, so this is
unnecessary and inconsistent, and only serves to confuse the reader.
Remove the pointless disable, simplifying armpmu_add() in the process.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf/arm_pmu.c')
-rw-r--r-- | drivers/perf/arm_pmu.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index a1dfe895cb1d..316c4dcc9856 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -235,20 +235,15 @@ armpmu_add(struct perf_event *event, int flags) struct pmu_hw_events *hw_events = this_cpu_ptr(armpmu->hw_events); struct hw_perf_event *hwc = &event->hw; int idx; - int err = 0; /* An event following a process won't be stopped earlier */ if (!cpumask_test_cpu(smp_processor_id(), &armpmu->supported_cpus)) return -ENOENT; - perf_pmu_disable(event->pmu); - /* If we don't have a space for the counter then finish early. */ idx = armpmu->get_event_idx(hw_events, event); - if (idx < 0) { - err = idx; - goto out; - } + if (idx < 0) + return idx; /* * If there is an event in the counter we are going to use then make @@ -265,9 +260,7 @@ armpmu_add(struct perf_event *event, int flags) /* Propagate our changes to the userspace mapping. */ perf_event_update_userpage(event); -out: - perf_pmu_enable(event->pmu); - return err; + return 0; } static int |