Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158300
b: refs/heads/master
c: 6ddf259
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Sep 3, 2009
1 parent e9e34a5 commit 63869a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0fbdea19e9394a5cb5f2f5081b028c50b558910a
refs/heads/master: 6ddf259da76cab6555c2086386f8bcd10bbb86d2
1 change: 1 addition & 0 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ static void create_counter(int counter, int cpu, pid_t pid)
attr->sample_type |= PERF_SAMPLE_CALLCHAIN;

if (raw_samples) {
attr->sample_type |= PERF_SAMPLE_TIME;
attr->sample_type |= PERF_SAMPLE_RAW;
attr->sample_type |= PERF_SAMPLE_CPU;
}
Expand Down
8 changes: 7 additions & 1 deletion trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
struct dso *dso = NULL;
struct thread *thread;
u64 ip = event->ip.ip;
u64 timestamp = -1;
u32 cpu = -1;
u64 period = 1;
void *more_data = event->ip.__more_data;
int cpumode;

thread = threads__findnew(event->ip.pid, &threads, &last_match);

if (sample_type & PERF_SAMPLE_TIME) {
timestamp = *(u64 *)more_data;
more_data += sizeof(u64);
}

if (sample_type & PERF_SAMPLE_CPU) {
cpu = *(u32 *)more_data;
more_data += sizeof(u32);
Expand Down Expand Up @@ -127,7 +133,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
* field, although it should be the same than this perf
* event pid
*/
print_event(cpu, raw->data, raw->size, 0, thread->comm);
print_event(cpu, raw->data, raw->size, timestamp, thread->comm);
}
total += period;

Expand Down

0 comments on commit 63869a5

Please sign in to comment.