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

From: David Ahern
Date: Mon Feb 23 2015 - 11:49:45 EST


Hi Peter:

On 2/18/15 10:45 AM, David Ahern wrote:
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.

Does this make sense or did I miss something about the pmu_enable/disable functions?

David


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;
}



--
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/