diff options
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 8247fd04745a..bbe4c444ef8f 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -58,12 +58,19 @@ 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 | u32 cpu = -1; | ||
61 | u64 period = 1; | 62 | u64 period = 1; |
62 | void *more_data = event->ip.__more_data; | 63 | void *more_data = event->ip.__more_data; |
63 | int cpumode; | 64 | int cpumode; |
64 | 65 | ||
65 | thread = threads__findnew(event->ip.pid, &threads, &last_match); | 66 | thread = threads__findnew(event->ip.pid, &threads, &last_match); |
66 | 67 | ||
68 | if (sample_type & PERF_SAMPLE_CPU) { | ||
69 | cpu = *(u32 *)more_data; | ||
70 | more_data += sizeof(u32); | ||
71 | more_data += sizeof(u32); /* reserved */ | ||
72 | } | ||
73 | |||
67 | if (sample_type & PERF_SAMPLE_PERIOD) { | 74 | if (sample_type & PERF_SAMPLE_PERIOD) { |
68 | period = *(u64 *)more_data; | 75 | period = *(u64 *)more_data; |
69 | more_data += sizeof(u64); | 76 | more_data += sizeof(u64); |
@@ -120,7 +127,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
120 | * field, although it should be the same than this perf | 127 | * field, although it should be the same than this perf |
121 | * event pid | 128 | * event pid |
122 | */ | 129 | */ |
123 | print_event(0, raw->data, raw->size, 0, thread->comm); | 130 | print_event(cpu, raw->data, raw->size, 0, thread->comm); |
124 | } | 131 | } |
125 | total += period; | 132 | total += period; |
126 | 133 | ||