Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759445Ab0FJQGW (ORCPT ); Thu, 10 Jun 2010 12:06:22 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:54709 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751984Ab0FJQGV (ORCPT ); Thu, 10 Jun 2010 12:06:21 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Ananth N Mavinakayanahalli , =?utf-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Ingo Molnar , Masami Hiramatsu , Peter Zijlstra , Srikar Dronamraju , Stephane Eranian , Tom Zanussi Subject: [PATCH 1/1] perf record: Don't call newt functions when not initialized Date: Thu, 10 Jun 2010 13:05:56 -0300 Message-Id: <1276185956-19099-2-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1276185956-19099-1-git-send-email-acme@infradead.org> References: <1276185956-19099-1-git-send-email-acme@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2145 Lines: 70 From: Arnaldo Carvalho de Melo When processing events we want to give visual feedback to the user when using the newt browser, so there are ui_progress calls in __perf_session__process_events, but those should check if newt is being used. Reported-by: Srikar Dronamraju Tested-by: Srikar Dronamraju Cc: Ananth N Mavinakayanahalli Cc: Frédéric Weisbecker Cc: Ingo Molnar Cc: Masami Hiramatsu , Cc: Peter Zijlstra Cc: Srikar Dronamraju Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: <20100609123530.GB9471@ghostprotocols.net> Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/newt.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index cf182ca..7537ca1 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c @@ -43,6 +43,9 @@ struct ui_progress *ui_progress__new(const char *title, u64 total) if (self != NULL) { int cols; + + if (use_browser <= 0) + return self; newtGetScreenSize(&cols, NULL); cols -= 4; newtCenteredWindow(cols, 1, title); @@ -67,14 +70,22 @@ out_free_self: void ui_progress__update(struct ui_progress *self, u64 curr) { + /* + * FIXME: We should have a per UI backend way of showing progress, + * stdio will just show a percentage as NN%, etc. + */ + if (use_browser <= 0) + return; newtScaleSet(self->scale, curr); newtRefresh(); } void ui_progress__delete(struct ui_progress *self) { - newtFormDestroy(self->form); - newtPopWindow(); + if (use_browser > 0) { + newtFormDestroy(self->form); + newtPopWindow(); + } free(self); } -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/