diff options
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 2302ec051bb4..50d0a931497a 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -263,11 +263,12 @@ static int __event__synthesize_thread(event_t *comm_event, event_t *mmap_event, | |||
263 | process, session); | 263 | process, session); |
264 | } | 264 | } |
265 | 265 | ||
266 | int event__synthesize_thread(pid_t pid, event__handler_t process, | 266 | int event__synthesize_thread_map(struct thread_map *threads, |
267 | struct perf_session *session) | 267 | event__handler_t process, |
268 | struct perf_session *session) | ||
268 | { | 269 | { |
269 | event_t *comm_event, *mmap_event; | 270 | event_t *comm_event, *mmap_event; |
270 | int err = -1; | 271 | int err = -1, thread; |
271 | 272 | ||
272 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); | 273 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); |
273 | if (comm_event == NULL) | 274 | if (comm_event == NULL) |
@@ -277,8 +278,15 @@ int event__synthesize_thread(pid_t pid, event__handler_t process, | |||
277 | if (mmap_event == NULL) | 278 | if (mmap_event == NULL) |
278 | goto out_free_comm; | 279 | goto out_free_comm; |
279 | 280 | ||
280 | err = __event__synthesize_thread(comm_event, mmap_event, pid, | 281 | err = 0; |
281 | process, session); | 282 | for (thread = 0; thread < threads->nr; ++thread) { |
283 | if (__event__synthesize_thread(comm_event, mmap_event, | ||
284 | threads->map[thread], | ||
285 | process, session)) { | ||
286 | err = -1; | ||
287 | break; | ||
288 | } | ||
289 | } | ||
282 | free(mmap_event); | 290 | free(mmap_event); |
283 | out_free_comm: | 291 | out_free_comm: |
284 | free(comm_event); | 292 | free(comm_event); |
@@ -459,7 +467,8 @@ int event__process_comm(event_t *self, struct sample_data *sample __used, | |||
459 | int event__process_lost(event_t *self, struct sample_data *sample __used, | 467 | int event__process_lost(event_t *self, struct sample_data *sample __used, |
460 | struct perf_session *session) | 468 | struct perf_session *session) |
461 | { | 469 | { |
462 | dump_printf(": id:%Ld: lost:%Ld\n", self->lost.id, self->lost.lost); | 470 | dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n", |
471 | self->lost.id, self->lost.lost); | ||
463 | session->hists.stats.total_lost += self->lost.lost; | 472 | session->hists.stats.total_lost += self->lost.lost; |
464 | return 0; | 473 | return 0; |
465 | } | 474 | } |
@@ -575,7 +584,7 @@ int event__process_mmap(event_t *self, struct sample_data *sample __used, | |||
575 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 584 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
576 | int ret = 0; | 585 | int ret = 0; |
577 | 586 | ||
578 | dump_printf(" %d/%d: [%#Lx(%#Lx) @ %#Lx]: %s\n", | 587 | dump_printf(" %d/%d: [%#" PRIx64 "(%#" PRIx64 ") @ %#" PRIx64 "]: %s\n", |
579 | self->mmap.pid, self->mmap.tid, self->mmap.start, | 588 | self->mmap.pid, self->mmap.tid, self->mmap.start, |
580 | self->mmap.len, self->mmap.pgoff, self->mmap.filename); | 589 | self->mmap.len, self->mmap.pgoff, self->mmap.filename); |
581 | 590 | ||