diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-07-23 08:46:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-02 07:47:56 -0400 |
commit | 9f498cc5be7e013d8d6e4c616980ed0ffc8680d2 (patch) | |
tree | 25ef7a52d61ffd336c73b42dcf770424beb19cf3 /include | |
parent | e53c0994709166b111fbe9162d1a16ece7dfc45b (diff) |
perf_counter: Full task tracing
In order to be able to distinguish between no samples due to
inactivity and no samples due to task ended, Arjan asked for
PERF_EVENT_EXIT events. This is useful to the boot delay
instrumentation (bootchart) app.
This patch changes the PERF_EVENT_FORK to be emitted on every
clone, and adds PERF_EVENT_EXIT to be emitted on task exit,
after the task's counters have been closed.
This task tracing is controlled through: attr.comm || attr.mmap
and through the new attr.task field.
Suggested-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
[ cleaned up perf_counter.h a bit ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_counter.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index bd15d7a5f5ce..e604e6ef72dd 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -181,8 +181,9 @@ struct perf_counter_attr { | |||
181 | freq : 1, /* use freq, not period */ | 181 | freq : 1, /* use freq, not period */ |
182 | inherit_stat : 1, /* per task counts */ | 182 | inherit_stat : 1, /* per task counts */ |
183 | enable_on_exec : 1, /* next exec enables */ | 183 | enable_on_exec : 1, /* next exec enables */ |
184 | task : 1, /* trace fork/exit */ | ||
184 | 185 | ||
185 | __reserved_1 : 51; | 186 | __reserved_1 : 50; |
186 | 187 | ||
187 | __u32 wakeup_events; /* wakeup every n events */ | 188 | __u32 wakeup_events; /* wakeup every n events */ |
188 | __u32 __reserved_2; | 189 | __u32 __reserved_2; |
@@ -311,6 +312,15 @@ enum perf_event_type { | |||
311 | /* | 312 | /* |
312 | * struct { | 313 | * struct { |
313 | * struct perf_event_header header; | 314 | * struct perf_event_header header; |
315 | * u32 pid, ppid; | ||
316 | * u32 tid, ptid; | ||
317 | * }; | ||
318 | */ | ||
319 | PERF_EVENT_EXIT = 4, | ||
320 | |||
321 | /* | ||
322 | * struct { | ||
323 | * struct perf_event_header header; | ||
314 | * u64 time; | 324 | * u64 time; |
315 | * u64 id; | 325 | * u64 id; |
316 | * u64 stream_id; | 326 | * u64 stream_id; |
@@ -323,6 +333,7 @@ enum perf_event_type { | |||
323 | * struct { | 333 | * struct { |
324 | * struct perf_event_header header; | 334 | * struct perf_event_header header; |
325 | * u32 pid, ppid; | 335 | * u32 pid, ppid; |
336 | * u32 tid, ptid; | ||
326 | * }; | 337 | * }; |
327 | */ | 338 | */ |
328 | PERF_EVENT_FORK = 7, | 339 | PERF_EVENT_FORK = 7, |