diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-03 06:00:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-03 09:45:49 -0400 |
commit | 6ddf259da76cab6555c2086386f8bcd10bbb86d2 (patch) | |
tree | 5f0b4a8eab0ffd31a72366e94ee7b7ba525066ee /tools/perf/builtin-trace.c | |
parent | 0fbdea19e9394a5cb5f2f5081b028c50b558910a (diff) |
perf trace: Sample timestamps as well
Before:
perf-21082 [013] 0.000000: sched_wakeup_new: task perf:21083 [120] success=1 [015]
perf-21082 [013] 0.000000: sched_migrate_task: task perf:21082 [120] from: 13 to: 15
perf-21082 [013] 0.000000: sched_process_fork: parent perf:21082 child perf:21083
true-21083 [015] 0.000000: sched_wakeup: task migration/15:33 [0] success=1 [015]
perf-21082 [013] 0.000000: sched_switch: task perf:21082 [120] (S) ==> swapper:0 [140]
true-21083 [015] 0.000000: sched_switch: task perf:21083 [120] (R) ==> migration/15:33 [0]
true-21083 [011] 0.000000: sched_process_exit: task true:21083 [120]
After:
perf-21082 [013] 14674.797613: sched_wakeup_new: task perf:21083 [120] success=1 [015]
perf-21082 [013] 14674.797506: sched_migrate_task: task perf:21082 [120] from: 13 to: 15
perf-21082 [013] 14674.797610: sched_process_fork: parent perf:21082 child perf:21083
true-21083 [015] 14674.797725: sched_wakeup: task migration/15:33 [0] success=1 [015]
perf-21082 [013] 14674.797722: sched_switch: task perf:21082 [120] (S) ==> swapper:0 [140]
true-21083 [015] 14674.797729: sched_switch: task perf:21083 [120] (R) ==> migration/15:33 [0]
true-21083 [011] 14674.798159: sched_process_exit: task true:21083 [120]
Cc: 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>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index bbe4c444ef8..d59bf8a8674 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -58,6 +58,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
58 | struct dso *dso = NULL; | 58 | struct dso *dso = NULL; |
59 | struct thread *thread; | 59 | struct thread *thread; |
60 | u64 ip = event->ip.ip; | 60 | u64 ip = event->ip.ip; |
61 | u64 timestamp = -1; | ||
61 | u32 cpu = -1; | 62 | u32 cpu = -1; |
62 | u64 period = 1; | 63 | u64 period = 1; |
63 | void *more_data = event->ip.__more_data; | 64 | void *more_data = event->ip.__more_data; |
@@ -65,6 +66,11 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
65 | 66 | ||
66 | thread = threads__findnew(event->ip.pid, &threads, &last_match); | 67 | thread = threads__findnew(event->ip.pid, &threads, &last_match); |
67 | 68 | ||
69 | if (sample_type & PERF_SAMPLE_TIME) { | ||
70 | timestamp = *(u64 *)more_data; | ||
71 | more_data += sizeof(u64); | ||
72 | } | ||
73 | |||
68 | if (sample_type & PERF_SAMPLE_CPU) { | 74 | if (sample_type & PERF_SAMPLE_CPU) { |
69 | cpu = *(u32 *)more_data; | 75 | cpu = *(u32 *)more_data; |
70 | more_data += sizeof(u32); | 76 | more_data += sizeof(u32); |
@@ -127,7 +133,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
127 | * field, although it should be the same than this perf | 133 | * field, although it should be the same than this perf |
128 | * event pid | 134 | * event pid |
129 | */ | 135 | */ |
130 | print_event(cpu, raw->data, raw->size, 0, thread->comm); | 136 | print_event(cpu, raw->data, raw->size, timestamp, thread->comm); |
131 | } | 137 | } |
132 | total += period; | 138 | total += period; |
133 | 139 | ||