Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Namhyung Kim and committed by
Jiri Olsa
22af969e 512ae1bd

+5 -9
+3 -3
tools/perf/builtin-report.c
··· 823 823 goto error; 824 824 } 825 825 826 + perf_hpp__init(); 827 + 826 828 /* Force tty output for header output. */ 827 829 if (report.header || report.header_only) 828 830 use_browser = 0; 829 831 830 832 if (strcmp(input_name, "-") != 0) 831 833 setup_browser(true); 832 - else { 834 + else 833 835 use_browser = 0; 834 - perf_hpp__init(); 835 - } 836 836 837 837 if (report.header || report.header_only) { 838 838 perf_session__fprintf_info(session, stdout,
+2
tools/perf/builtin-top.c
··· 1147 1147 /* display thread wants entries to be collapsed in a different tree */ 1148 1148 sort__need_collapse = 1; 1149 1149 1150 + perf_hpp__init(); 1151 + 1150 1152 if (top.use_stdio) 1151 1153 use_browser = 0; 1152 1154 else if (top.use_tui)
-2
tools/perf/ui/browsers/hists.c
··· 661 661 662 662 void hist_browser__init_hpp(void) 663 663 { 664 - perf_hpp__init(); 665 - 666 664 perf_hpp__format[PERF_HPP__OVERHEAD].color = 667 665 hist_browser__hpp_color_overhead; 668 666 perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color =
-2
tools/perf/ui/gtk/hists.c
··· 58 58 59 59 void perf_gtk__init_hpp(void) 60 60 { 61 - perf_hpp__init(); 62 - 63 61 perf_hpp__format[PERF_HPP__OVERHEAD].color = 64 62 perf_gtk__hpp_color_overhead; 65 63 perf_hpp__format[PERF_HPP__OVERHEAD_SYS].color =
-2
tools/perf/ui/setup.c
··· 86 86 use_browser = 0; 87 87 if (fallback_to_pager) 88 88 setup_pager(); 89 - 90 - perf_hpp__init(); 91 89 break; 92 90 } 93 91 }