Skip to content

Commit

Permalink
perf: Simplify __perf_event_sync_stat
Browse files Browse the repository at this point in the history
Removes constraints from __perf_event_read() by leaving it with
a single callsite; this callsite had ctx->lock held, the other
one does not.

Removes some superfluous code from __perf_event_sync_stat().

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091120212508.918544317@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Nov 21, 2009
1 parent f6f8378 commit 3dbebf1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,6 @@ static int context_equiv(struct perf_event_context *ctx1,
&& !ctx1->pin_count && !ctx2->pin_count;
}

static void __perf_event_read(void *event);

static void __perf_event_sync_stat(struct perf_event *event,
struct perf_event *next_event)
{
Expand All @@ -1080,8 +1078,8 @@ static void __perf_event_sync_stat(struct perf_event *event,
*/
switch (event->state) {
case PERF_EVENT_STATE_ACTIVE:
__perf_event_read(event);
break;
event->pmu->read(event);
/* fall-through */

case PERF_EVENT_STATE_INACTIVE:
update_event_times(event);
Expand Down

0 comments on commit 3dbebf1

Please sign in to comment.