Skip to content

Commit

Permalink
perf_counter: Add counter->id to the throttle event
Browse files Browse the repository at this point in the history
So as to be able to distuinguish between multiple counters.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 11, 2009
1 parent a308444 commit cca3f45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ enum perf_event_type {
* struct {
* struct perf_event_header header;
* u64 time;
* u64 id;
* };
*/
PERF_EVENT_THROTTLE = 5,
Expand Down
4 changes: 3 additions & 1 deletion kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2950,13 +2950,15 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
struct {
struct perf_event_header header;
u64 time;
u64 id;
} throttle_event = {
.header = {
.type = PERF_EVENT_THROTTLE + 1,
.misc = 0,
.size = sizeof(throttle_event),
},
.time = sched_clock(),
.time = sched_clock(),
.id = counter->id,
};

ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);
Expand Down

0 comments on commit cca3f45

Please sign in to comment.