aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index fbf5754c8866..2b15c362ef56 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -424,33 +424,6 @@ int perf_event__synthesize_kernel_mmap(perf_event__handler_t process,
424 return err; 424 return err;
425} 425}
426 426
427static void thread__comm_adjust(struct thread *self, struct hists *hists)
428{
429 char *comm = self->comm;
430
431 if (!symbol_conf.col_width_list_str && !symbol_conf.field_sep &&
432 (!symbol_conf.comm_list ||
433 strlist__has_entry(symbol_conf.comm_list, comm))) {
434 u16 slen = strlen(comm);
435
436 if (hists__new_col_len(hists, HISTC_COMM, slen))
437 hists__set_col_len(hists, HISTC_THREAD, slen + 6);
438 }
439}
440
441static int thread__set_comm_adjust(struct thread *self, const char *comm,
442 struct hists *hists)
443{
444 int ret = thread__set_comm(self, comm);
445
446 if (ret)
447 return ret;
448
449 thread__comm_adjust(self, hists);
450
451 return 0;
452}
453
454int perf_event__process_comm(union perf_event *event, 427int perf_event__process_comm(union perf_event *event,
455 struct perf_sample *sample __used, 428 struct perf_sample *sample __used,
456 struct perf_session *session) 429 struct perf_session *session)
@@ -459,8 +432,7 @@ int perf_event__process_comm(union perf_event *event,
459 432
460 dump_printf(": %s:%d\n", event->comm.comm, event->comm.tid); 433 dump_printf(": %s:%d\n", event->comm.comm, event->comm.tid);
461 434
462 if (thread == NULL || thread__set_comm_adjust(thread, event->comm.comm, 435 if (thread == NULL || thread__set_comm(thread, event->comm.comm)) {
463 &session->hists)) {
464 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n"); 436 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
465 return -1; 437 return -1;
466 } 438 }
@@ -760,18 +732,6 @@ void thread__find_addr_location(struct thread *self,
760 al->sym = NULL; 732 al->sym = NULL;
761} 733}
762 734
763static void dso__calc_col_width(struct dso *self, struct hists *hists)
764{
765 if (!symbol_conf.col_width_list_str && !symbol_conf.field_sep &&
766 (!symbol_conf.dso_list ||
767 strlist__has_entry(symbol_conf.dso_list, self->name))) {
768 u16 slen = dso__name_len(self);
769 hists__new_col_len(hists, HISTC_DSO, slen);
770 }
771
772 self->slen_calculated = 1;
773}
774
775int perf_event__preprocess_sample(const union perf_event *event, 735int perf_event__preprocess_sample(const union perf_event *event,
776 struct perf_session *session, 736 struct perf_session *session,
777 struct addr_location *al, 737 struct addr_location *al,
@@ -817,23 +777,8 @@ int perf_event__preprocess_sample(const union perf_event *event,
817 strlist__has_entry(symbol_conf.dso_list, 777 strlist__has_entry(symbol_conf.dso_list,
818 al->map->dso->long_name))))) 778 al->map->dso->long_name)))))
819 goto out_filtered; 779 goto out_filtered;
820 /*
821 * We have to do this here as we may have a dso with no symbol
822 * hit that has a name longer than the ones with symbols
823 * sampled.
824 */
825 if (!sort_dso.elide && !al->map->dso->slen_calculated)
826 dso__calc_col_width(al->map->dso, &session->hists);
827 780
828 al->sym = map__find_symbol(al->map, al->addr, filter); 781 al->sym = map__find_symbol(al->map, al->addr, filter);
829 } else {
830 const unsigned int unresolved_col_width = BITS_PER_LONG / 4;
831
832 if (hists__col_len(&session->hists, HISTC_DSO) < unresolved_col_width &&
833 !symbol_conf.col_width_list_str && !symbol_conf.field_sep &&
834 !symbol_conf.dso_list)
835 hists__set_col_len(&session->hists, HISTC_DSO,
836 unresolved_col_width);
837 } 782 }
838 783
839 if (symbol_conf.sym_list && al->sym && 784 if (symbol_conf.sym_list && al->sym &&