aboutsummaryrefslogtreecommitdiff
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-04-08 15:01:30 +0200
committerIngo Molnar <mingo@elte.hu>2009-04-08 19:05:47 +0200
commit8d1b2d9361b494bfc761700c348c65ebbe3deb5b (patch)
tree284706b328133063bf530cb47c52a827b523b65a /include/linux/perf_counter.h
parent8740f9418c78dcad694b46ab25d1645d5aef1f5e (diff)
perf_counter: track task-comm data
Similar to the mmap data stream, add one that tracks the task COMM field, so that the userspace reporting knows what to call a task. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> LKML-Reference: <20090408130409.127422406@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 8bf764fc622..a70a55f2759 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -142,8 +142,9 @@ struct perf_counter_hw_event {
exclude_idle : 1, /* don't count when idle */
mmap : 1, /* include mmap data */
munmap : 1, /* include munmap data */
+ comm : 1, /* include comm data */
- __reserved_1 : 53;
+ __reserved_1 : 52;
__u32 extra_config_len;
__u32 wakeup_events; /* wakeup every n events */
@@ -231,6 +232,16 @@ enum perf_event_type {
PERF_EVENT_MUNMAP = 2,
/*
+ * struct {
+ * struct perf_event_header header;
+ *
+ * u32 pid, tid;
+ * char comm[];
+ * };
+ */
+ PERF_EVENT_COMM = 3,
+
+ /*
* When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field
* will be PERF_RECORD_*
*
@@ -545,6 +556,8 @@ extern void perf_counter_mmap(unsigned long addr, unsigned long len,
extern void perf_counter_munmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file);
+extern void perf_counter_comm(struct task_struct *tsk);
+
#define MAX_STACK_DEPTH 255
struct perf_callchain_entry {
@@ -583,6 +596,7 @@ static inline void
perf_counter_munmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file) { }
+static inline void perf_counter_comm(struct task_struct *tsk) { }
#endif
#endif /* __KERNEL__ */