Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753822AbbDRPud (ORCPT ); Sat, 18 Apr 2015 11:50:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753381AbbDRPub (ORCPT ); Sat, 18 Apr 2015 11:50:31 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: David Ahern , Frederic Weisbecker , He Kuang , Ingo Molnar , Jeremie Galarneau , Namhyung Kim , Paul Mackerras , Peter Zijlstra , Sebastian Andrzej Siewior , Tom Zanussi , Wang Nan , lkml Subject: [PATCH 1/7] perf data: Show error message when conversion failed Date: Sat, 18 Apr 2015 17:50:14 +0200 Message-Id: <1429372220-6406-2-git-send-email-jolsa@kernel.org> In-Reply-To: <1429372220-6406-1-git-send-email-jolsa@kernel.org> References: <1429372220-6406-1-git-send-email-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1769 Lines: 60 From: He Kuang Show message when errors occurred during conversion setup and conversion process. Before this patch: $ ./perf data convert --to-ctf=ctf $ echo $? 255 After this patch: $ ./perf data convert --to-ctf=ctf Error during conversion setup. Signed-off-by: He Kuang Link: http://lkml.kernel.org/n/tip-xvhr1vf7zav9kkeo9w1hv4uk@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/data-convert-bt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index dd17c9a32fbc..db4f709af18d 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -837,6 +837,8 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) err = perf_session__process_events(session); if (!err) err = bt_ctf_stream_flush(cw->stream); + else + pr_err("Error during conversion.\n"); fprintf(stderr, "[ perf data convert: Converted '%s' into CTF data '%s' ]\n", @@ -847,11 +849,15 @@ int bt_convert__perf2ctf(const char *input, const char *path, bool force) (double) c.events_size / 1024.0 / 1024.0, c.events_count); - /* its all good */ -free_session: perf_session__delete(session); + ctf_writer__cleanup(cw); + return err; + +free_session: + perf_session__delete(session); free_writer: ctf_writer__cleanup(cw); + pr_err("Error during conversion setup.\n"); return err; } -- 1.9.3 -- 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/