diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-18 16:20:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-19 07:42:34 -0400 |
commit | f9188e023c248d73f5b4a589b480e065c1864068 (patch) | |
tree | 86efe8c89c318fdf9b9db8471680ba225ec8f4e2 /include/linux/perf_counter.h | |
parent | b8e6d829729d1a5991a9f628205b671cac2ec06f (diff) |
perf_counter: Make callchain samples extensible
Before exposing upstream tools to a callchain-samples ABI, tidy it
up to make it more extensible in the future:
Use markers in the IP chain to denote context, use (u64)-1..-4095 range
for these context markers because we use them for ERR_PTR(), so these
addresses are unlikely to be mapped.
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>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 0765e8e69843..e7e7e0242767 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -343,23 +343,22 @@ enum perf_event_type { | |||
343 | * { u64 nr; | 343 | * { u64 nr; |
344 | * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP | 344 | * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP |
345 | * | 345 | * |
346 | * { u16 nr, | 346 | * { u64 nr, |
347 | * hv, | ||
348 | * kernel, | ||
349 | * user; | ||
350 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | 347 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN |
351 | * }; | 348 | * }; |
352 | */ | 349 | */ |
353 | }; | 350 | }; |
354 | 351 | ||
355 | #define MAX_STACK_DEPTH 255 | 352 | enum perf_callchain_context { |
353 | PERF_CONTEXT_HV = (__u64)-32, | ||
354 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
355 | PERF_CONTEXT_USER = (__u64)-512, | ||
356 | 356 | ||
357 | struct perf_callchain_entry { | 357 | PERF_CONTEXT_GUEST = (__u64)-2048, |
358 | __u16 nr; | 358 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, |
359 | __u16 hv; | 359 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, |
360 | __u16 kernel; | 360 | |
361 | __u16 user; | 361 | PERF_CONTEXT_MAX = (__u64)-4095, |
362 | __u64 ip[MAX_STACK_DEPTH]; | ||
363 | }; | 362 | }; |
364 | 363 | ||
365 | #ifdef __KERNEL__ | 364 | #ifdef __KERNEL__ |
@@ -381,6 +380,13 @@ struct perf_callchain_entry { | |||
381 | #include <linux/pid_namespace.h> | 380 | #include <linux/pid_namespace.h> |
382 | #include <asm/atomic.h> | 381 | #include <asm/atomic.h> |
383 | 382 | ||
383 | #define PERF_MAX_STACK_DEPTH 255 | ||
384 | |||
385 | struct perf_callchain_entry { | ||
386 | __u64 nr; | ||
387 | __u64 ip[PERF_MAX_STACK_DEPTH]; | ||
388 | }; | ||
389 | |||
384 | struct task_struct; | 390 | struct task_struct; |
385 | 391 | ||
386 | /** | 392 | /** |