All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seokho Song <0xdevssh@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Seokho Song <0xdevssh@gmail.com>,
	Park Ju Hyung <qkrwngud825@gmail.com>
Subject: [PATCH v2] perf tools: set browser mode right before setup_browser()
Date: Tue,  5 Dec 2017 01:02:44 +0900	[thread overview]
Message-ID: <20171204160244.6332-1-0xdevssh@gmail.com> (raw)

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 <namhyung@kernel.org>
Signed-off-by: Seokho Song <0xdevssh@gmail.com>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
---
 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

             reply	other threads:[~2017-12-04 16:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 16:02 Seokho Song [this message]
2017-12-06 16:44 ` [tip:perf/core] perf report: Set browser mode right before setup_browser() tip-bot for Seokho Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171204160244.6332-1-0xdevssh@gmail.com \
    --to=0xdevssh@gmail.com \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=qkrwngud825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.