From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752149AbdLDPpq (ORCPT ); Mon, 4 Dec 2017 10:45:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:34894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbdLDPpo (ORCPT ); Mon, 4 Dec 2017 10:45:44 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF40E218B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Mon, 4 Dec 2017 12:45:41 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Song Seok Ho <0xdevssh@gmail.com>, linux-kernel@vger.kernel.org, Jiri Olsa Subject: Re: [PATCH] perf tools: set GUI mode after returning from perf_session__new() Message-ID: <20171204154541.GD13698@kernel.org> References: <20171203135038.16977-1-0xdevssh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Dec 05, 2017 at 12:05:18AM +0900, Namhyung Kim escreveu: > Hi SeokHo, > > On Sun, Dec 3, 2017 at 10:50 PM, Song Seok Ho <0xdevssh@gmail.com> wrote: > > 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. > > I'm ok with this change, but it needs to consider other error messages too. > There are more pr_err() calls between perf_session__new() and > setup_browser(), so I think they have same problem. So I think I can apply this one, with Namhyung's acked-by and then Song can continue with followup patches? - Arnaldo > Thanks, > Namhyung > > > > > > Signed-off-by: Song Seok Ho <0xdevssh@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..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 > >