perf_counter: Initialize ->oncpu properly
[pandora-kernel.git] / kernel / perf_counter.c
index ec9c400..367299f 100644 (file)
@@ -2576,7 +2576,7 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
                .time = sched_clock(),
        };
 
-       ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 0, 0);
+       ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);
        if (ret)
                return;
 
@@ -3122,6 +3122,8 @@ perf_counter_alloc(struct perf_counter_hw_event *hw_event,
        counter->group_leader           = group_leader;
        counter->pmu                    = NULL;
        counter->ctx                    = ctx;
+       counter->oncpu                  = -1;
+
        get_ctx(ctx);
 
        counter->state = PERF_COUNTER_STATE_INACTIVE;
@@ -3449,8 +3451,6 @@ void perf_counter_exit_task(struct task_struct *child)
        struct perf_counter_context *child_ctx;
        unsigned long flags;
 
-       WARN_ON_ONCE(child != current);
-
        child_ctx = child->perf_counter_ctxp;
 
        if (likely(!child_ctx))