Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dbebf15 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

perf: Simplify __perf_event_sync_stat



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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091120212508.918544317@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent f6f83785
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -1061,8 +1061,6 @@ static int context_equiv(struct perf_event_context *ctx1,
		&& !ctx1->pin_count && !ctx2->pin_count;
		&& !ctx1->pin_count && !ctx2->pin_count;
}
}


static void __perf_event_read(void *event);

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


	case PERF_EVENT_STATE_INACTIVE:
	case PERF_EVENT_STATE_INACTIVE:
		update_event_times(event);
		update_event_times(event);