diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
| -rw-r--r-- | tools/perf/builtin-report.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f57a23b19f3c..015c79745966 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -55,9 +55,6 @@ static char callchain_default_opt[] = "fractal,0.5"; | |||
| 55 | static char *cwd; | 55 | static char *cwd; |
| 56 | static int cwdlen; | 56 | static int cwdlen; |
| 57 | 57 | ||
| 58 | static struct rb_root threads; | ||
| 59 | static struct thread *last_match; | ||
| 60 | |||
| 61 | static struct perf_header *header; | 58 | static struct perf_header *header; |
| 62 | 59 | ||
| 63 | static u64 sample_type; | 60 | static u64 sample_type; |
| @@ -593,15 +590,13 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
| 593 | { | 590 | { |
| 594 | char level; | 591 | char level; |
| 595 | struct symbol *sym = NULL; | 592 | struct symbol *sym = NULL; |
| 596 | struct thread *thread; | ||
| 597 | u64 ip = event->ip.ip; | 593 | u64 ip = event->ip.ip; |
| 598 | u64 period = 1; | 594 | u64 period = 1; |
| 599 | struct map *map = NULL; | 595 | struct map *map = NULL; |
| 600 | void *more_data = event->ip.__more_data; | 596 | void *more_data = event->ip.__more_data; |
| 601 | struct ip_callchain *chain = NULL; | 597 | struct ip_callchain *chain = NULL; |
| 602 | int cpumode; | 598 | int cpumode; |
| 603 | 599 | struct thread *thread = threads__findnew(event->ip.pid); | |
| 604 | thread = threads__findnew(event->ip.pid, &threads, &last_match); | ||
| 605 | 600 | ||
| 606 | if (sample_type & PERF_SAMPLE_PERIOD) { | 601 | if (sample_type & PERF_SAMPLE_PERIOD) { |
| 607 | period = *(u64 *)more_data; | 602 | period = *(u64 *)more_data; |
| @@ -685,10 +680,8 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head) | |||
| 685 | static int | 680 | static int |
| 686 | process_mmap_event(event_t *event, unsigned long offset, unsigned long head) | 681 | process_mmap_event(event_t *event, unsigned long offset, unsigned long head) |
| 687 | { | 682 | { |
| 688 | struct thread *thread; | ||
| 689 | struct map *map = map__new(&event->mmap, cwd, cwdlen); | 683 | struct map *map = map__new(&event->mmap, cwd, cwdlen); |
| 690 | 684 | struct thread *thread = threads__findnew(event->mmap.pid); | |
| 691 | thread = threads__findnew(event->mmap.pid, &threads, &last_match); | ||
| 692 | 685 | ||
| 693 | dump_printf("%p [%p]: PERF_RECORD_MMAP %d/%d: [%p(%p) @ %p]: %s\n", | 686 | dump_printf("%p [%p]: PERF_RECORD_MMAP %d/%d: [%p(%p) @ %p]: %s\n", |
| 694 | (void *)(offset + head), | 687 | (void *)(offset + head), |
| @@ -714,9 +707,7 @@ process_mmap_event(event_t *event, unsigned long offset, unsigned long head) | |||
| 714 | static int | 707 | static int |
| 715 | process_comm_event(event_t *event, unsigned long offset, unsigned long head) | 708 | process_comm_event(event_t *event, unsigned long offset, unsigned long head) |
| 716 | { | 709 | { |
| 717 | struct thread *thread; | 710 | struct thread *thread = threads__findnew(event->comm.pid); |
| 718 | |||
| 719 | thread = threads__findnew(event->comm.pid, &threads, &last_match); | ||
| 720 | 711 | ||
| 721 | dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n", | 712 | dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n", |
| 722 | (void *)(offset + head), | 713 | (void *)(offset + head), |
| @@ -736,11 +727,8 @@ process_comm_event(event_t *event, unsigned long offset, unsigned long head) | |||
| 736 | static int | 727 | static int |
| 737 | process_task_event(event_t *event, unsigned long offset, unsigned long head) | 728 | process_task_event(event_t *event, unsigned long offset, unsigned long head) |
| 738 | { | 729 | { |
| 739 | struct thread *thread; | 730 | struct thread *thread = threads__findnew(event->fork.pid); |
| 740 | struct thread *parent; | 731 | struct thread *parent = threads__findnew(event->fork.ppid); |
| 741 | |||
| 742 | thread = threads__findnew(event->fork.pid, &threads, &last_match); | ||
| 743 | parent = threads__findnew(event->fork.ppid, &threads, &last_match); | ||
| 744 | 732 | ||
| 745 | dump_printf("%p [%p]: PERF_RECORD_%s: (%d:%d):(%d:%d)\n", | 733 | dump_printf("%p [%p]: PERF_RECORD_%s: (%d:%d):(%d:%d)\n", |
| 746 | (void *)(offset + head), | 734 | (void *)(offset + head), |
| @@ -857,7 +845,7 @@ static int __cmd_report(void) | |||
| 857 | struct thread *idle; | 845 | struct thread *idle; |
| 858 | int ret; | 846 | int ret; |
| 859 | 847 | ||
| 860 | idle = register_idle_thread(&threads, &last_match); | 848 | idle = register_idle_thread(); |
| 861 | thread__comm_adjust(idle); | 849 | thread__comm_adjust(idle); |
| 862 | 850 | ||
| 863 | if (show_threads) | 851 | if (show_threads) |
| @@ -881,7 +869,7 @@ static int __cmd_report(void) | |||
| 881 | return 0; | 869 | return 0; |
| 882 | 870 | ||
| 883 | if (verbose > 3) | 871 | if (verbose > 3) |
| 884 | threads__fprintf(stdout, &threads); | 872 | threads__fprintf(stdout); |
| 885 | 873 | ||
| 886 | if (verbose > 2) | 874 | if (verbose > 2) |
| 887 | dsos__fprintf(stdout); | 875 | dsos__fprintf(stdout); |
