Skip to content

Commit

Permalink
perf_counter: Fix throttle/unthrottle event logging
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <20090722130546.GE9029@kryten>
  • Loading branch information
antonblanchard authored and Peter Zijlstra committed Jul 22, 2009
1 parent a054123 commit 966ee4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand All @@ -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;
Expand Down

0 comments on commit 966ee4d

Please sign in to comment.