diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-04-15 22:04:51 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-05-21 05:45:35 -0400 |
commit | 22af969e8cfc6ea46d3e1a774a16d7e19b8cf4db (patch) | |
tree | e8c2e0b30db28e500d31b5ef6ec55a0aaa26ae3e /tools | |
parent | 512ae1bd6acb811c72e44e2540099eccd31f773d (diff) |
perf tools: Call perf_hpp__init() before setting up GUI browsers
So that it can be set properly prior to set up output fields. That
makes easy to handle/warn errors during the setup since it doesn't
need to be bothered with the GUI.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1400480762-22852-11-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-report.c | 6 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/setup.c | 2 |
5 files changed, 5 insertions, 9 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f4d640cfdf16..c4dab7acbdbb 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -823,16 +823,16 @@ repeat: | |||
823 | goto error; | 823 | goto error; |
824 | } | 824 | } |
825 | 825 | ||
826 | perf_hpp__init(); | ||
827 | |||
826 | /* Force tty output for header output. */ | 828 | /* Force tty output for header output. */ |
827 | if (report.header || report.header_only) | 829 | if (report.header || report.header_only) |
828 | use_browser = 0; | 830 | use_browser = 0; |
829 | 831 | ||
830 | if (strcmp(input_name, "-") != 0) | 832 | if (strcmp(input_name, "-") != 0) |
831 | setup_browser(true); | 833 | setup_browser(true); |
832 | else { | 834 | else |
833 | use_browser = 0; | 835 | use_browser = 0; |
834 | perf_hpp__init(); | ||
835 | } | ||
836 | 836 | ||
837 | if (report.header || report.header_only) { | 837 | if (report.header || report.header_only) { |
838 | perf_session__fprintf_info(session, stdout, | 838 | perf_session__fprintf_info(session, stdout, |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 34764b6eabf9..280945bab66d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1147,6 +1147,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1147 | /* display thread wants entries to be collapsed in a different tree */ | 1147 | /* display thread wants entries to be collapsed in a different tree */ |
1148 | sort__need_collapse = 1; | 1148 | sort__need_collapse = 1; |
1149 | 1149 | ||
1150 | perf_hpp__init(); | ||
1151 | |||
1150 | if (top.use_stdio) | 1152 | if (top.use_stdio) |
1151 | use_browser = 0; | 1153 | use_browser = 0; |
1152 | else if (top.use_tui) | 1154 | else if (top.use_tui) |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 37c5188fd68a..92d128f3acdc 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -661,8 +661,6 @@ __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) | |||
661 | 661 | ||
662 | void hist_browser__init_hpp(void) | 662 | void hist_browser__init_hpp(void) |
663 | { | 663 | { |
664 | perf_hpp__init(); | ||
665 | |||
666 | perf_hpp__format[PERF_HPP__OVERHEAD].color = | 664 | perf_hpp__format[PERF_HPP__OVERHEAD].color = |
667 | hist_browser__hpp_color_overhead; | 665 | hist_browser__hpp_color_overhead; |
668 | perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color = | 666 | perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color = |
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 2237245bfac0..fd52669018ee 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -58,8 +58,6 @@ __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) | |||
58 | 58 | ||
59 | void perf_gtk__init_hpp(void) | 59 | void perf_gtk__init_hpp(void) |
60 | { | 60 | { |
61 | perf_hpp__init(); | ||
62 | |||
63 | perf_hpp__format[PERF_HPP__OVERHEAD].color = | 61 | perf_hpp__format[PERF_HPP__OVERHEAD].color = |
64 | perf_gtk__hpp_color_overhead; | 62 | perf_gtk__hpp_color_overhead; |
65 | perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color = | 63 | perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color = |
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c index 5df5140a9f29..ba51fa8a1176 100644 --- a/tools/perf/ui/setup.c +++ b/tools/perf/ui/setup.c | |||
@@ -86,8 +86,6 @@ void setup_browser(bool fallback_to_pager) | |||
86 | use_browser = 0; | 86 | use_browser = 0; |
87 | if (fallback_to_pager) | 87 | if (fallback_to_pager) |
88 | setup_pager(); | 88 | setup_pager(); |
89 | |||
90 | perf_hpp__init(); | ||
91 | break; | 89 | break; |
92 | } | 90 | } |
93 | } | 91 | } |