summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-02 15:08:15 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-02 21:45:29 +0200
commit8e5799b1ad2a0567fdfaaf0e91b40efee010f2c1 (patch)
treebd3f45c348f48411a4496229572643211cbd59b8 /include/linux/perf_counter.h
parent53e111a730ea8b002d57dd226098c12789993329 (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.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 9ec20fc6bd3..4845a214b9e 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -114,8 +114,9 @@ enum perf_counter_record_format {
* in increasing order of bit value, after the counter value.
*/
enum perf_counter_read_format {
- PERF_FORMAT_TOTAL_TIME_ENABLED = 1,
- PERF_FORMAT_TOTAL_TIME_RUNNING = 2,
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
+ PERF_FORMAT_ID = 1U << 2,
};
/*
@@ -290,7 +291,7 @@ enum perf_event_type {
* { u32 cpu, res; } && PERF_RECORD_CPU
*
* { u64 nr;
- * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP
+ * { u64 id, val; } cnt[nr]; } && PERF_RECORD_GROUP
*
* { u16 nr,
* hv,
@@ -503,6 +504,7 @@ struct perf_counter {
struct rcu_head rcu_head;
struct pid_namespace *ns;
+ u64 id;
#endif
};