Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad...
[pandora-kernel.git] / kernel / events / core.c
index 600c162..d3b9df5 100644 (file)
@@ -2174,11 +2174,11 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
         */
        cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
 
-       perf_event_sched_in(cpuctx, ctx, task);
-
        if (ctx->nr_events)
                cpuctx->task_ctx = ctx;
 
+       perf_event_sched_in(cpuctx, cpuctx->task_ctx, task);
+
        perf_pmu_enable(ctx->pmu);
        perf_ctx_unlock(cpuctx, ctx);