Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158297
b: refs/heads/master
c: cd6feee
h: refs/heads/master
i:
  158295: 53c61b3
v: v3
  • Loading branch information
Ingo Molnar committed Sep 2, 2009
1 parent 7a6c43f commit 59472d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 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: 65014ab36196f6d86edc9ee23759d6930b9d89a8
refs/heads/master: cd6feeeafddbef6abfe4d90fb26e42fd844d34ed
4 changes: 3 additions & 1 deletion trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,10 @@ static void create_counter(int counter, int cpu, pid_t pid)
if (call_graph)
attr->sample_type |= PERF_SAMPLE_CALLCHAIN;

if (raw_samples)
if (raw_samples) {
attr->sample_type |= PERF_SAMPLE_RAW;
attr->sample_type |= PERF_SAMPLE_CPU;
}

attr->mmap = track;
attr->comm = track;
Expand Down
9 changes: 8 additions & 1 deletion trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +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;
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_CPU) {
cpu = *(u32 *)more_data;
more_data += sizeof(u32);
more_data += sizeof(u32); /* reserved */
}

if (sample_type & PERF_SAMPLE_PERIOD) {
period = *(u64 *)more_data;
more_data += sizeof(u64);
Expand Down Expand Up @@ -120,7 +127,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(0, raw->data, raw->size, 0, thread->comm);
print_event(cpu, raw->data, raw->size, 0, thread->comm);
}
total += period;

Expand Down

0 comments on commit 59472d4

Please sign in to comment.