diff options
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 12 | ||||
-rw-r--r-- | tools/perf/ui/hist.c | 15 | ||||
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 10 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 |
4 files changed, 20 insertions, 18 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 49db16334814..a6d5d248b8fb 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -2067,7 +2067,6 @@ void hist_browser__init(struct hist_browser *browser, | |||
2067 | struct hists *hists) | 2067 | struct hists *hists) |
2068 | { | 2068 | { |
2069 | struct perf_hpp_fmt *fmt; | 2069 | struct perf_hpp_fmt *fmt; |
2070 | struct perf_hpp_list_node *node; | ||
2071 | 2070 | ||
2072 | browser->hists = hists; | 2071 | browser->hists = hists; |
2073 | browser->b.refresh = hist_browser__refresh; | 2072 | browser->b.refresh = hist_browser__refresh; |
@@ -2076,15 +2075,10 @@ void hist_browser__init(struct hist_browser *browser, | |||
2076 | browser->b.use_navkeypressed = true; | 2075 | browser->b.use_navkeypressed = true; |
2077 | browser->show_headers = symbol_conf.show_hist_headers; | 2076 | browser->show_headers = symbol_conf.show_hist_headers; |
2078 | 2077 | ||
2079 | hists__for_each_format(hists, fmt) { | 2078 | hists__for_each_format(hists, fmt) |
2080 | perf_hpp__reset_width(fmt, hists); | ||
2081 | ++browser->b.columns; | 2079 | ++browser->b.columns; |
2082 | } | 2080 | |
2083 | /* hierarchy entries have their own hpp list */ | 2081 | hists__reset_column_width(hists); |
2084 | list_for_each_entry(node, &hists->hpp_formats, list) { | ||
2085 | perf_hpp_list__for_each_format(&node->hpp, fmt) | ||
2086 | perf_hpp__reset_width(fmt, hists); | ||
2087 | } | ||
2088 | } | 2082 | } |
2089 | 2083 | ||
2090 | struct hist_browser *hist_browser__new(struct hists *hists) | 2084 | struct hist_browser *hist_browser__new(struct hists *hists) |
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index b47fafc8ee2a..60c4a4d08374 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -699,6 +699,21 @@ void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists) | |||
699 | } | 699 | } |
700 | } | 700 | } |
701 | 701 | ||
702 | void hists__reset_column_width(struct hists *hists) | ||
703 | { | ||
704 | struct perf_hpp_fmt *fmt; | ||
705 | struct perf_hpp_list_node *node; | ||
706 | |||
707 | hists__for_each_format(hists, fmt) | ||
708 | perf_hpp__reset_width(fmt, hists); | ||
709 | |||
710 | /* hierarchy entries have their own hpp list */ | ||
711 | list_for_each_entry(node, &hists->hpp_formats, list) { | ||
712 | perf_hpp_list__for_each_format(&node->hpp, fmt) | ||
713 | perf_hpp__reset_width(fmt, hists); | ||
714 | } | ||
715 | } | ||
716 | |||
702 | void perf_hpp__set_user_width(const char *width_list_str) | 717 | void perf_hpp__set_user_width(const char *width_list_str) |
703 | { | 718 | { |
704 | struct perf_hpp_fmt *fmt; | 719 | struct perf_hpp_fmt *fmt; |
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index a57131e61fe3..8e1840bff29d 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -717,8 +717,6 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | |||
717 | int max_cols, float min_pcnt, FILE *fp, | 717 | int max_cols, float min_pcnt, FILE *fp, |
718 | bool use_callchain) | 718 | bool use_callchain) |
719 | { | 719 | { |
720 | struct perf_hpp_fmt *fmt; | ||
721 | struct perf_hpp_list_node *node; | ||
722 | struct rb_node *nd; | 720 | struct rb_node *nd; |
723 | size_t ret = 0; | 721 | size_t ret = 0; |
724 | const char *sep = symbol_conf.field_sep; | 722 | const char *sep = symbol_conf.field_sep; |
@@ -729,13 +727,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | |||
729 | 727 | ||
730 | init_rem_hits(); | 728 | init_rem_hits(); |
731 | 729 | ||
732 | hists__for_each_format(hists, fmt) | 730 | hists__reset_column_width(hists); |
733 | perf_hpp__reset_width(fmt, hists); | ||
734 | /* hierarchy entries have their own hpp list */ | ||
735 | list_for_each_entry(node, &hists->hpp_formats, list) { | ||
736 | perf_hpp_list__for_each_format(&node->hpp, fmt) | ||
737 | perf_hpp__reset_width(fmt, hists); | ||
738 | } | ||
739 | 731 | ||
740 | if (symbol_conf.col_width_list_str) | 732 | if (symbol_conf.col_width_list_str) |
741 | perf_hpp__set_user_width(symbol_conf.col_width_list_str); | 733 | perf_hpp__set_user_width(symbol_conf.col_width_list_str); |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index a002c93fe422..defa957f27df 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -368,6 +368,7 @@ static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format, | |||
368 | void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists); | 368 | void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists); |
369 | void perf_hpp__reset_sort_width(struct perf_hpp_fmt *fmt, struct hists *hists); | 369 | void perf_hpp__reset_sort_width(struct perf_hpp_fmt *fmt, struct hists *hists); |
370 | void perf_hpp__set_user_width(const char *width_list_str); | 370 | void perf_hpp__set_user_width(const char *width_list_str); |
371 | void hists__reset_column_width(struct hists *hists); | ||
371 | 372 | ||
372 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); | 373 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); |
373 | typedef int (*hpp_callback_fn)(struct perf_hpp *hpp, bool front); | 374 | typedef int (*hpp_callback_fn)(struct perf_hpp *hpp, bool front); |