Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbbDHEyj (ORCPT ); Wed, 8 Apr 2015 00:54:39 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:58812 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbbDHEyg (ORCPT ); Wed, 8 Apr 2015 00:54:36 -0400 From: He Kuang To: , , , , CC: , Subject: [PATCH 1/2] perf data: Show error message when ctf setup failed Date: Wed, 8 Apr 2015 12:49:19 +0800 Message-ID: <1428468560-27401-1-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 2.3.3.220.g9ab698f MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.197.189] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5524B488.00EB,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b9fc72c70e0797e2db2437d3a84cd07e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1268 Lines: 46 Show message when errors occurred during ctf conversion setup. Before this patch: $ ./perf data convert --to-ctf=ctf $ echo $? 255 After this patch: $ ./perf data convert --to-ctf=ctf Error during CTF convert setup. Signed-off-by: He Kuang --- tools/perf/util/data-convert-bt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index dd17c9a..a5b89b9 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -847,11 +847,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 CTF convert setup.\n"); return err; } -- 2.3.3.220.g9ab698f -- 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/