Skip to content

Commit

Permalink
perf/x86: Remove redundant calls to perf_pmu_{dis|en}able()
Browse files Browse the repository at this point in the history
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@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1424281543-67335-1-git-send-email-dsahern@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
David Ahern authored and Ingo Molnar committed Mar 27, 2015
1 parent 936c663 commit 9332d25
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1082,7 +1081,6 @@ static int x86_pmu_add(struct perf_event *event, int flags)

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

Expand Down

0 comments on commit 9332d25

Please sign in to comment.