mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-25 07:43:59 +00:00
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>
This commit is contained in:
parent
3071f13d75
commit
a9e469d1c8
1 changed files with 3 additions and 10 deletions
|
@ -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 pmu_hw_events *hw_events = this_cpu_ptr(armpmu->hw_events);
|
||||||
struct hw_perf_event *hwc = &event->hw;
|
struct hw_perf_event *hwc = &event->hw;
|
||||||
int idx;
|
int idx;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
/* An event following a process won't be stopped earlier */
|
/* An event following a process won't be stopped earlier */
|
||||||
if (!cpumask_test_cpu(smp_processor_id(), &armpmu->supported_cpus))
|
if (!cpumask_test_cpu(smp_processor_id(), &armpmu->supported_cpus))
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
perf_pmu_disable(event->pmu);
|
|
||||||
|
|
||||||
/* If we don't have a space for the counter then finish early. */
|
/* If we don't have a space for the counter then finish early. */
|
||||||
idx = armpmu->get_event_idx(hw_events, event);
|
idx = armpmu->get_event_idx(hw_events, event);
|
||||||
if (idx < 0) {
|
if (idx < 0)
|
||||||
err = idx;
|
return idx;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is an event in the counter we are going to use then make
|
* 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. */
|
/* Propagate our changes to the userspace mapping. */
|
||||||
perf_event_update_userpage(event);
|
perf_event_update_userpage(event);
|
||||||
|
|
||||||
out:
|
return 0;
|
||||||
perf_pmu_enable(event->pmu);
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Reference in a new issue