perf_counter: Fix throttle/unthrottle event logging
PATCH 1/1 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 <[email protected]>
---
kernel/perf_counter.c +4 -1
@@ -3195,7 +3195,7 @@ static void perf_log_throttle(struct peru64 stream_id; } throttle_event = { .header = { - .type = PERF_EVENT_THROTTLE + 1, + .type = PERF_EVENT_THROTTLE, .misc = 0, .size = sizeof(throttle_event), },
@@ -3204,6 +3204,9 @@ static void perf_log_throttle(struct per .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 ;
Quoted 2 lines · Anton Blanchard
Right now we only print
PERF_EVENT_THROTTLE+ 1 (iePERF_EVENT_UNTHROTTLE). Fix this to print both a throttle and unthrottle event.
oops, that was supposed to read: PERF_EVEN_THROTTLE + enable, but yeah, the below works too. Thanks!
Quoted 26 lines
Signed-off-by Anton Blanchard <[email protected]>---
Index:
linux.trees.git/kernel/perf_counter.c
===================================================================kernel/perf_counter.c +4
-1@@ -3195,7 +3195,7 @@ static void perf_log_throttle(struct peru64 stream_id; } throttle_event = { .header = { - .type = PERF_EVENT_THROTTLE + 1, + .type = PERF_EVENT_THROTTLE, .misc = 0, .size = sizeof(throttle_event), },@@ -3204,6 +3204,9 @@ static void perf_log_throttle(struct per .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 ;