[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171203135038.16977-1-0xdevssh@gmail.com>
Date: Sun, 3 Dec 2017 22:50:38 +0900
From: Song Seok Ho <0xdevssh@...il.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Song Seok Ho <0xdevssh@...il.com>
Subject: [PATCH] perf tools: set GUI mode after returning from perf_session__new()
If perf_session__new() returns NULL with use_browser set to 2 via --gtk option
previously, perf dies quietly without printing any errors.
The reason behind this is that GTK is not yet initialized when the caller
inside perf_session__new() is trying to print error message to the screen.
Reorder code to print the messages to stdio when GTK is not yet ready.
Signed-off-by: Song Seok Ho <0xdevssh@...il.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..0cd80b8c432e 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)
@@ -949,6 +942,13 @@ int cmd_report(int argc, const char **argv)
if (session == NULL)
return -1;
+ 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.queue_size) {
ordered_events__set_alloc_size(&session->ordered_events,
report.queue_size);
--
2.15.1
Powered by blists - more mailing lists