From: Anton Blanchard Date: Wed, 22 Jul 2009 13:05:46 +0000 (+1000) Subject: perf_counter: Fix throttle/unthrottle event logging X-Git-Tag: v3.0~8404^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=966ee4d6b887c14159043ac80b8c3661d2bbe5e2;p=platform%2Fkernel%2Flinux-amlogic.git perf_counter: Fix throttle/unthrottle event logging Right now we only print PERF_EVENT_THROTTLE + 1 (ie PERF_EVENT_UNTHROTTLE). Fix this to print both a throttle and unthrottle event. Signed-off-by: Anton Blanchard Signed-off-by: Peter Zijlstra LKML-Reference: <20090722130546.GE9029@kryten> --- diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 7530588..787d4da 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -3217,7 +3217,7 @@ static void perf_log_throttle(struct perf_counter *counter, int enable) u64 stream_id; } throttle_event = { .header = { - .type = PERF_EVENT_THROTTLE + 1, + .type = PERF_EVENT_THROTTLE, .misc = 0, .size = sizeof(throttle_event), }, @@ -3226,6 +3226,9 @@ static void perf_log_throttle(struct perf_counter *counter, int enable) .stream_id = counter->id, }; + if (enable) + throttle_event.header.type = PERF_EVENT_UNTHROTTLE; + ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0); if (ret) return;