Commit 966ee4d6 authored by Anton Blanchard's avatar Anton Blanchard Committed by Peter Zijlstra

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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090722130546.GE9029@kryten>
parent a0541234
...@@ -3217,7 +3217,7 @@ static void perf_log_throttle(struct perf_counter *counter, int enable) ...@@ -3217,7 +3217,7 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
u64 stream_id; u64 stream_id;
} throttle_event = { } throttle_event = {
.header = { .header = {
.type = PERF_EVENT_THROTTLE + 1, .type = PERF_EVENT_THROTTLE,
.misc = 0, .misc = 0,
.size = sizeof(throttle_event), .size = sizeof(throttle_event),
}, },
...@@ -3226,6 +3226,9 @@ static void perf_log_throttle(struct perf_counter *counter, int enable) ...@@ -3226,6 +3226,9 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
.stream_id = counter->id, .stream_id = counter->id,
}; };
if (enable)
throttle_event.header.type = PERF_EVENT_UNTHROTTLE;
ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0); ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);
if (ret) if (ret)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment