When --hierarchy option is used, each entry has its own hpp_list to show
the result.  But it missed to update width of each column.

Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/ui/stdio/hist.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 9b65f4a6b35a..83ca728b6f61 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -733,6 +733,7 @@ size_t hists__fprintf(struct hists *hists, bool 
show_header, int max_rows,
                      bool use_callchain)
 {
        struct perf_hpp_fmt *fmt;
+       struct perf_hpp_list_node *node;
        struct rb_node *nd;
        size_t ret = 0;
        const char *sep = symbol_conf.field_sep;
@@ -745,6 +746,11 @@ size_t hists__fprintf(struct hists *hists, bool 
show_header, int max_rows,
 
        hists__for_each_format(hists, fmt)
                perf_hpp__reset_width(fmt, hists);
+       /* hierarchy entries have their own hpp list */
+       list_for_each_entry(node, &hists->hpp_formats, list) {
+               perf_hpp_list__for_each_format(&node->hpp, fmt)
+                       perf_hpp__reset_width(fmt, hists);
+       }
 
        if (symbol_conf.col_width_list_str)
                perf_hpp__set_user_width(symbol_conf.col_width_list_str);
-- 
2.9.3

Reply via email to