diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-09-20 07:30:24 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-09-20 21:13:37 +0200 |
commit | e3b60bc93d81e0542ac433df226b8de8b963533e (patch) | |
tree | cf0fb6858530dd6f9ca1b3ca2728cb3d369bc2a4 /tools/perf/ui/browsers | |
parent | perf ui/tui: Reset output width for hierarchy (diff) | |
download | linux-e3b60bc93d81e0542ac433df226b8de8b963533e.tar.xz linux-e3b60bc93d81e0542ac433df226b8de8b963533e.zip |
perf hists: Factor out hists__reset_column_width()
The stdio and tui has same code to reset hpp format column width.
Factor it out as a new function.
Suggested-and-Acked-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20160920053025.13989-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 12 |
1 files changed, 3 insertions, 9 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, struct hists *hists) { struct perf_hpp_fmt *fmt; - struct perf_hpp_list_node *node; browser->hists = hists; browser->b.refresh = hist_browser__refresh; @@ -2076,15 +2075,10 @@ void hist_browser__init(struct hist_browser *browser, browser->b.use_navkeypressed = true; browser->show_headers = symbol_conf.show_hist_headers; - hists__for_each_format(hists, fmt) { - perf_hpp__reset_width(fmt, hists); + hists__for_each_format(hists, fmt) ++browser->b.columns; - } - /* 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); - } + + hists__reset_column_width(hists); } struct hist_browser *hist_browser__new(struct hists *hists) |