diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-06-20 17:58:16 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-22 08:56:35 -0400 |
commit | b1c7a8f7a1dad1aa46ec26cdfa487598634c5267 (patch) | |
tree | a5d73a0af8f436d968e1f52716d34c53a37c335e /tools/perf/ui | |
parent | 5b91a86f47669898d6f2fe625844ab65cf258c34 (diff) |
perf hists browser: Move horizontal scroll init to new()
Moving horizontal scroll init to initialization function as already
intended.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1466459899-1166-6-git-send-email-jolsa@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.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index a74cbd381607..ccb9ed62a037 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -2049,6 +2049,8 @@ struct hist_browser *hist_browser__new(struct hists *hists, | |||
2049 | struct hist_browser *browser = zalloc(sizeof(*browser)); | 2049 | struct hist_browser *browser = zalloc(sizeof(*browser)); |
2050 | 2050 | ||
2051 | if (browser) { | 2051 | if (browser) { |
2052 | struct perf_hpp_fmt *fmt; | ||
2053 | |||
2052 | browser->hists = hists; | 2054 | browser->hists = hists; |
2053 | browser->b.refresh = hist_browser__refresh; | 2055 | browser->b.refresh = hist_browser__refresh; |
2054 | browser->b.refresh_dimensions = hist_browser__refresh_dimensions; | 2056 | browser->b.refresh_dimensions = hist_browser__refresh_dimensions; |
@@ -2058,6 +2060,11 @@ struct hist_browser *hist_browser__new(struct hists *hists, | |||
2058 | browser->hbt = hbt; | 2060 | browser->hbt = hbt; |
2059 | browser->env = env; | 2061 | browser->env = env; |
2060 | browser->title = perf_evsel_browser_title; | 2062 | browser->title = perf_evsel_browser_title; |
2063 | |||
2064 | hists__for_each_format(hists, fmt) { | ||
2065 | perf_hpp__reset_width(fmt, hists); | ||
2066 | ++browser->b.columns; | ||
2067 | } | ||
2061 | } | 2068 | } |
2062 | 2069 | ||
2063 | return browser; | 2070 | return browser; |
@@ -2654,7 +2661,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
2654 | int key = -1; | 2661 | int key = -1; |
2655 | char buf[64]; | 2662 | char buf[64]; |
2656 | int delay_secs = hbt ? hbt->refresh : 0; | 2663 | int delay_secs = hbt ? hbt->refresh : 0; |
2657 | struct perf_hpp_fmt *fmt; | ||
2658 | 2664 | ||
2659 | #define HIST_BROWSER_HELP_COMMON \ | 2665 | #define HIST_BROWSER_HELP_COMMON \ |
2660 | "h/?/F1 Show this window\n" \ | 2666 | "h/?/F1 Show this window\n" \ |
@@ -2713,18 +2719,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
2713 | memset(options, 0, sizeof(options)); | 2719 | memset(options, 0, sizeof(options)); |
2714 | memset(actions, 0, sizeof(actions)); | 2720 | memset(actions, 0, sizeof(actions)); |
2715 | 2721 | ||
2716 | hists__for_each_format(browser->hists, fmt) { | ||
2717 | perf_hpp__reset_width(fmt, hists); | ||
2718 | /* | ||
2719 | * This is done just once, and activates the horizontal scrolling | ||
2720 | * code in the ui_browser code, it would be better to have a the | ||
2721 | * counter in the perf_hpp code, but I couldn't find doing it here | ||
2722 | * works, FIXME by setting this in hist_browser__new, for now, be | ||
2723 | * clever 8-) | ||
2724 | */ | ||
2725 | ++browser->b.columns; | ||
2726 | } | ||
2727 | |||
2728 | if (symbol_conf.col_width_list_str) | 2722 | if (symbol_conf.col_width_list_str) |
2729 | perf_hpp__set_user_width(symbol_conf.col_width_list_str); | 2723 | perf_hpp__set_user_width(symbol_conf.col_width_list_str); |
2730 | 2724 | ||