aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index cdd46ab11bd5..cdf9a8d27bb9 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -666,12 +666,9 @@ static void dso__calc_col_width(struct dso *self)
666 self->slen_calculated = 1; 666 self->slen_calculated = 1;
667} 667}
668 668
669static int thread__set_comm_adjust(struct thread *self, const char *comm) 669static void thread__comm_adjust(struct thread *self)
670{ 670{
671 int ret = thread__set_comm(self, comm); 671 char *comm = self->comm;
672
673 if (ret)
674 return ret;
675 672
676 if (!col_width_list_str && !field_sep && 673 if (!col_width_list_str && !field_sep &&
677 (!comm_list || strlist__has_entry(comm_list, comm))) { 674 (!comm_list || strlist__has_entry(comm_list, comm))) {
@@ -682,6 +679,16 @@ static int thread__set_comm_adjust(struct thread *self, const char *comm)
682 threads__col_width = slen + 6; 679 threads__col_width = slen + 6;
683 } 680 }
684 } 681 }
682}
683
684static int thread__set_comm_adjust(struct thread *self, const char *comm)
685{
686 int ret = thread__set_comm(self, comm);
687
688 if (ret)
689 return ret;
690
691 thread__comm_adjust(self);
685 692
686 return 0; 693 return 0;
687} 694}
@@ -1073,17 +1080,6 @@ print_entries:
1073 return ret; 1080 return ret;
1074} 1081}
1075 1082
1076static void register_idle_thread(void)
1077{
1078 struct thread *thread = threads__findnew(0, &threads, &last_match);
1079
1080 if (thread == NULL ||
1081 thread__set_comm_adjust(thread, "[idle]")) {
1082 fprintf(stderr, "problem inserting idle task.\n");
1083 exit(-1);
1084 }
1085}
1086
1087static unsigned long total = 0, 1083static unsigned long total = 0,
1088 total_mmap = 0, 1084 total_mmap = 0,
1089 total_comm = 0, 1085 total_comm = 0,
@@ -1381,11 +1377,13 @@ static int __cmd_report(void)
1381 unsigned long offset = 0; 1377 unsigned long offset = 0;
1382 unsigned long head, shift; 1378 unsigned long head, shift;
1383 struct stat input_stat; 1379 struct stat input_stat;
1380 struct thread *idle;
1384 event_t *event; 1381 event_t *event;
1385 uint32_t size; 1382 uint32_t size;
1386 char *buf; 1383 char *buf;
1387 1384
1388 register_idle_thread(); 1385 idle = register_idle_thread(&threads, &last_match);
1386 thread__comm_adjust(idle);
1389 1387
1390 if (show_threads) 1388 if (show_threads)
1391 perf_read_values_init(&show_threads_values); 1389 perf_read_values_init(&show_threads_values);