aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-18 10:03:46 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-18 10:06:18 -0400
commit4273b005875c34beda4a11c9d4a9132d80378036 (patch)
treef59197ba5886aaff8cb1fd3b7da2eeec1c03e52f /tools/perf
parent1f18345bdfd489fde1085bc85839d5d3645cf511 (diff)
perf tools: Fix comm column adjusting
The librarization of the thread helpers between annotate and report lost some perf report specifics. This patch fixes the thread comm column adjusting that has been omitted during this export. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> LKML-Reference: <1250604226-6852-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-report.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 1e3ad22d53dc..3fc0d471b90b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -665,6 +665,27 @@ static void dso__calc_col_width(struct dso *self)
665 self->slen_calculated = 1; 665 self->slen_calculated = 1;
666} 666}
667 667
668static int thread__set_comm_adjust(struct thread *self, const char *comm)
669{
670 int ret = thread__set_comm(self, comm);
671
672 if (ret)
673 return ret;
674
675 if (!col_width_list_str && !field_sep &&
676 (!comm_list || strlist__has_entry(comm_list, comm))) {
677 unsigned int slen = strlen(comm);
678
679 if (slen > comms__col_width) {
680 comms__col_width = slen;
681 threads__col_width = slen + 6;
682 }
683 }
684
685 return 0;
686}
687
688
668static struct symbol * 689static struct symbol *
669resolve_symbol(struct thread *thread, struct map **mapp, 690resolve_symbol(struct thread *thread, struct map **mapp,
670 struct dso **dsop, u64 *ipp) 691 struct dso **dsop, u64 *ipp)
@@ -1056,7 +1077,7 @@ static void register_idle_thread(void)
1056 struct thread *thread = threads__findnew(0, &threads, &last_match); 1077 struct thread *thread = threads__findnew(0, &threads, &last_match);
1057 1078
1058 if (thread == NULL || 1079 if (thread == NULL ||
1059 thread__set_comm(thread, "[idle]")) { 1080 thread__set_comm_adjust(thread, "[idle]")) {
1060 fprintf(stderr, "problem inserting idle task.\n"); 1081 fprintf(stderr, "problem inserting idle task.\n");
1061 exit(-1); 1082 exit(-1);
1062 } 1083 }
@@ -1226,7 +1247,7 @@ process_comm_event(event_t *event, unsigned long offset, unsigned long head)
1226 event->comm.comm, event->comm.pid); 1247 event->comm.comm, event->comm.pid);
1227 1248
1228 if (thread == NULL || 1249 if (thread == NULL ||
1229 thread__set_comm(thread, event->comm.comm)) { 1250 thread__set_comm_adjust(thread, event->comm.comm)) {
1230 dump_printf("problem processing PERF_EVENT_COMM, skipping event.\n"); 1251 dump_printf("problem processing PERF_EVENT_COMM, skipping event.\n");
1231 return -1; 1252 return -1;
1232 } 1253 }