[PATCH] perf/x86: Remove redundant calls to perf_pmu_{dis|en}able

From: David Ahern
Date: Wed Feb 18 2015 - 12:46:25 EST


perf_pmu_disable is called before pmu->add and perf_pmu_enable is called
afterwards. No need to call these inside of x86_pmu_add as well.

Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/perf_event.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index b71a7f86d68a..2d1675816bef 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1033,7 +1033,6 @@ static int x86_pmu_add(struct perf_event *event, int flags)

hwc = &event->hw;

- perf_pmu_disable(event->pmu);
n0 = cpuc->n_events;
ret = n = collect_events(cpuc, event, false);
if (ret < 0)
@@ -1071,7 +1070,6 @@ static int x86_pmu_add(struct perf_event *event, int flags)

ret = 0;
out:
- perf_pmu_enable(event->pmu);
return ret;
}

--
1.9.3 (Apple Git-50)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/