diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-02 09:08:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-02 15:45:29 -0400 |
commit | 8e5799b1ad2a0567fdfaaf0e91b40efee010f2c1 (patch) | |
tree | bd3f45c348f48411a4496229572643211cbd59b8 /include/linux/perf_counter.h | |
parent | 53e111a730ea8b002d57dd226098c12789993329 (diff) |
perf_counter: Add unique counter id
Stephan raised the issue that we currently cannot distinguish between
similar counters within a group (PERF_RECORD_GROUP uses the config
value as identifier).
Therefore, generate a new ID for each counter using a global u64
sequence counter.
Reported-by: Stephane Eranian <eranian@googlemail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 9ec20fc6bd36..4845a214b9e7 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -114,8 +114,9 @@ enum perf_counter_record_format { | |||
114 | * in increasing order of bit value, after the counter value. | 114 | * in increasing order of bit value, after the counter value. |
115 | */ | 115 | */ |
116 | enum perf_counter_read_format { | 116 | enum perf_counter_read_format { |
117 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1, | 117 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, |
118 | PERF_FORMAT_TOTAL_TIME_RUNNING = 2, | 118 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, |
119 | PERF_FORMAT_ID = 1U << 2, | ||
119 | }; | 120 | }; |
120 | 121 | ||
121 | /* | 122 | /* |
@@ -290,7 +291,7 @@ enum perf_event_type { | |||
290 | * { u32 cpu, res; } && PERF_RECORD_CPU | 291 | * { u32 cpu, res; } && PERF_RECORD_CPU |
291 | * | 292 | * |
292 | * { u64 nr; | 293 | * { u64 nr; |
293 | * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP | 294 | * { u64 id, val; } cnt[nr]; } && PERF_RECORD_GROUP |
294 | * | 295 | * |
295 | * { u16 nr, | 296 | * { u16 nr, |
296 | * hv, | 297 | * hv, |
@@ -503,6 +504,7 @@ struct perf_counter { | |||
503 | struct rcu_head rcu_head; | 504 | struct rcu_head rcu_head; |
504 | 505 | ||
505 | struct pid_namespace *ns; | 506 | struct pid_namespace *ns; |
507 | u64 id; | ||
506 | #endif | 508 | #endif |
507 | }; | 509 | }; |
508 | 510 | ||