From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753200AbdLDQDS (ORCPT ); Mon, 4 Dec 2017 11:03:18 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34628 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbdLDQDL (ORCPT ); Mon, 4 Dec 2017 11:03:11 -0500 X-Google-Smtp-Source: AGs4zMbi5x7PTMRXsx3It0JZKLWN3PWuHsySU8CZgtBg0IrUJjCqXLBBEh+ShQ8jQWBQKvsObsOsxA== From: Seokho Song <0xdevssh@gmail.com> To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Seokho Song <0xdevssh@gmail.com>, Park Ju Hyung Subject: [PATCH v2] perf tools: set browser mode right before setup_browser() Date: Tue, 5 Dec 2017 01:02:44 +0900 Message-Id: <20171204160244.6332-1-0xdevssh@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Acked-by: Namhyung Kim Signed-off-by: Seokho Song <0xdevssh@gmail.com> Signed-off-by: Park Ju Hyung --- tools/perf/builtin-report.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 1394cd8d96f7..c763390084b9 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -918,13 +918,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) @@ -1011,6 +1004,13 @@ int cmd_report(int argc, const char **argv) 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; -- 2.15.1