perf report: Set browser mode right before setup_browser()
authorSeokho Song <0xdevssh@gmail.com>
Mon, 4 Dec 2017 16:02:44 +0000 (01:02 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Dec 2017 18:43:56 +0000 (15:43 -0300)
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: Seokho Song <0xdevssh@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20171204160244.6332-1-0xdevssh@gmail.com
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-report.c

index af5dd038195e3f6e3a6877d5884efda263e46843..eb9ce6327e71b0cfe1a9338553a974576f8a5bb5 100644 (file)
@@ -921,13 +921,6 @@ int cmd_report(int argc, const char **argv)
                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)
                callchain_param.order = ORDER_CALLER;
        if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
@@ -1014,6 +1007,13 @@ repeat:
                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. */
        if (report.header || report.header_only || report.show_threads)
                use_browser = 0;