aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-07-31 01:47:41 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-12 11:03:07 -0400
commit59dc9f2534569d11a55c8b5dbe93c36f2b2fa506 (patch)
treeb86d86851eacab906ebfc957ae45311b039c1bb7 /tools/perf/ui
parent1ecd44533a8a724f64d4305abb69836ca73c7390 (diff)
perf tools: Fix column alignment when headers aren't shown on TUI
If user sets ui.show-headers config option to false, it didn't calculate default column width so it broke the alignment. This is because it does the calculation just before showing headers. Move it to the beginning of the hist browser so that it can be called regardless of the config option. Reported-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1406785662-5534-8-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/hists.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e07d4e848d5c..045c1e16ac59 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -850,9 +850,6 @@ static int hists__scnprintf_headers(char *buf, size_t size, struct hists *hists)
850 if (perf_hpp__should_skip(fmt)) 850 if (perf_hpp__should_skip(fmt))
851 continue; 851 continue;
852 852
853 /* We need to ensure length of the columns header. */
854 perf_hpp__reset_width(fmt, hists);
855
856 ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists)); 853 ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
857 if (advance_hpp_check(&dummy_hpp, ret)) 854 if (advance_hpp_check(&dummy_hpp, ret))
858 break; 855 break;
@@ -1501,6 +1498,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1501 char buf[64]; 1498 char buf[64];
1502 char script_opt[64]; 1499 char script_opt[64];
1503 int delay_secs = hbt ? hbt->refresh : 0; 1500 int delay_secs = hbt ? hbt->refresh : 0;
1501 struct perf_hpp_fmt *fmt;
1504 1502
1505#define HIST_BROWSER_HELP_COMMON \ 1503#define HIST_BROWSER_HELP_COMMON \
1506 "h/?/F1 Show this window\n" \ 1504 "h/?/F1 Show this window\n" \
@@ -1550,6 +1548,9 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1550 1548
1551 memset(options, 0, sizeof(options)); 1549 memset(options, 0, sizeof(options));
1552 1550
1551 perf_hpp__for_each_format(fmt)
1552 perf_hpp__reset_width(fmt, hists);
1553
1553 if (symbol_conf.col_width_list_str) 1554 if (symbol_conf.col_width_list_str)
1554 perf_hpp__set_user_width(symbol_conf.col_width_list_str); 1555 perf_hpp__set_user_width(symbol_conf.col_width_list_str);
1555 1556