diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-record.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index ff93f8ecba28..99a12fe86e9f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -404,6 +404,7 @@ static void create_counter(int counter, int cpu, pid_t pid) | |||
404 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; | 404 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; |
405 | 405 | ||
406 | if (raw_samples) { | 406 | if (raw_samples) { |
407 | attr->sample_type |= PERF_SAMPLE_TIME; | ||
407 | attr->sample_type |= PERF_SAMPLE_RAW; | 408 | attr->sample_type |= PERF_SAMPLE_RAW; |
408 | attr->sample_type |= PERF_SAMPLE_CPU; | 409 | attr->sample_type |= PERF_SAMPLE_CPU; |
409 | } | 410 | } |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index bbe4c444ef8f..d59bf8a86743 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 | ||