perf/x86: Remove redundant calls to perf_pmu_{dis|en}able()
authorDavid Ahern <[email protected]>
Wed, 18 Feb 2015 17:45:43 +0000 (10:45 -0700)
committerIngo Molnar <[email protected]>
Fri, 27 Mar 2015 08:49:44 +0000 (09:49 +0100)
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 <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/cpu/perf_event.c

index ec6e982fd46440cf31f1d0ffa5cb6e285d368589..ac41b3ad1fc98685ec9d9d1f106fc1f13c01cd57 100644 (file)
@@ -1044,7 +1044,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)
@@ -1082,7 +1081,6 @@ done_collect:
 
        ret = 0;
 out:
-       perf_pmu_enable(event->pmu);
        return ret;
 }