perf sort: Calculate parent column width too
authorNamhyung Kim <[email protected]>
Thu, 27 Dec 2012 09:11:42 +0000 (18:11 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 24 Jan 2013 19:40:24 +0000 (16:40 -0300)
When hists__calc_col_len() called, most of column length are refreshed
but it missed parent column.  So if the parent sort key was used along
with other keys rests will be misalinged since parent has no proper
column width.

Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/hist.c

index 965ebf948f2f39432a7c90dbc4f5e8c45fa5a80e..9485c7024f5bb8ce020bb243b453fa3ed3aadf86 100644 (file)
@@ -82,6 +82,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
                hists__new_col_len(hists, HISTC_DSO, len);
        }
 
+       if (h->parent)
+               hists__new_col_len(hists, HISTC_PARENT, h->parent->namelen);
+
        if (h->branch_info) {
                int symlen;
                /*