Commit 712d36db authored by Seokho Song's avatar Seokho Song Committed by Arnaldo Carvalho de Melo

perf report: Set browser mode right before setup_browser()

There are codes that print messages to the screen between assignment of
the use_browser variable and setup_browser().

But since the GUI browser is not initialized during that period, all
messages fail to show if the user passed the --gtk option to perf as GTK
is not initialized yet.

Reorder the code to assign use_browser variable right before
setup_browser() is called.
Signed-off-by: default avatarSeokho Song <0xdevssh@gmail.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20171204160244.6332-1-0xdevssh@gmail.comSigned-off-by: default avatarPark Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c343bade
...@@ -921,13 +921,6 @@ int cmd_report(int argc, const char **argv) ...@@ -921,13 +921,6 @@ int cmd_report(int argc, const char **argv)
return -EINVAL; return -EINVAL;
} }
if (report.use_stdio)
use_browser = 0;
else if (report.use_tui)
use_browser = 1;
else if (report.use_gtk)
use_browser = 2;
if (report.inverted_callchain) if (report.inverted_callchain)
callchain_param.order = ORDER_CALLER; callchain_param.order = ORDER_CALLER;
if (symbol_conf.cumulate_callchain && !callchain_param.order_set) if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
...@@ -1014,6 +1007,13 @@ int cmd_report(int argc, const char **argv) ...@@ -1014,6 +1007,13 @@ int cmd_report(int argc, const char **argv)
perf_hpp_list.need_collapse = true; perf_hpp_list.need_collapse = true;
} }
if (report.use_stdio)
use_browser = 0;
else if (report.use_tui)
use_browser = 1;
else if (report.use_gtk)
use_browser = 2;
/* Force tty output for header output and per-thread stat. */ /* Force tty output for header output and per-thread stat. */
if (report.header || report.header_only || report.show_threads) if (report.header || report.header_only || report.show_threads)
use_browser = 0; use_browser = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment