diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-10 16:53:54 -0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-10-27 10:18:21 +0100 |
commit | 3809f3c3039a655e0ae74d07d8136fd88ef37a7b (patch) | |
tree | 25816b3a925109f8c438be5a15b178037caf9eb7 /tools | |
parent | c02574a3927a425fc6aaf5e19df51e14a287d7eb (diff) | |
download | lwn-3809f3c3039a655e0ae74d07d8136fd88ef37a7b.tar.gz lwn-3809f3c3039a655e0ae74d07d8136fd88ef37a7b.zip |
perf hists: Update the column width for the "srcline" sort key
commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream.
When we introduce a new sort key, we need to update the
hists__calc_col_len() function accordingly, otherwise the width
will be limited to strlen(header).
We can't update it when obtaining a line value for a column (for
instance, in sort__srcline_cmp()), because we reset it all when doing a
resort (see hists__output_recalc_col_len()), so we need to, from what is
in the hist_entry fields, set each of the column widths.
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Fixes: 409a8be61560 ("perf tools: Add sort by src line/number")
Link: http://lkml.kernel.org/n/tip-jgbe0yx8v1gs89cslr93pvz2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/hist.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 9ff6cf3e9a99..b1c914413c5f 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -160,6 +160,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) hists__new_col_len(hists, HISTC_MEM_LVL, 21 + 3); hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12); hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12); + + if (h->srcline) + hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline)); } void hists__output_recalc_col_len(struct hists *hists, int max_rows) |