From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758922Ab0EBW7R (ORCPT ); Sun, 2 May 2010 18:59:17 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:51465 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758827Ab0EBW7P (ORCPT ); Sun, 2 May 2010 18:59:15 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , =?utf-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Mike Galbraith , Paul Mackerras , Peter Zijlstra , Tom Zanussi Subject: [PATCH 4/5] perf record: Don't exit in live mode when no tracepoints are enabled Date: Sun, 2 May 2010 19:59:01 -0300 Message-Id: <1272841142-26029-5-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1272841142-26029-1-git-send-email-acme@infradead.org> References: <1272841142-26029-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 From: Arnaldo Carvalho de Melo With this I was able to actually test Tom Zanussi's two previous patches in my usual perf testing ways, i.e. without any tracepoints activated. Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e382d93..ac989e9 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -666,12 +666,15 @@ static int __cmd_record(int argc, const char **argv) nr_counters, process_synthesized_event, session); - if (err <= 0) { - pr_err("Couldn't record tracing data.\n"); - return err; - } - - advance_output(err); + /* + * FIXME err <= 0 here actually means that there were no tracepoints + * so its not really an error, just that we don't need to synthesize + * anything. + * We really have to return this more properly and also propagate + * errors that now are calling die() + */ + if (err > 0) + advance_output(err); } machine = perf_session__find_host_machine(session); -- 1.6.2.5