Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934862AbbDIJpb (ORCPT ); Thu, 9 Apr 2015 05:45:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932659AbbDIJpZ (ORCPT ); Thu, 9 Apr 2015 05:45:25 -0400 Date: Thu, 9 Apr 2015 11:45:21 +0200 From: Jiri Olsa To: He Kuang Cc: bigeasy@linutronix.de, jolsa@kernel.org, acme@kernel.org, a.p.zijlstra@chello.nl, mingo@redhat.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 1/2] perf data: Show error message when conversion failed Message-ID: <20150409094521.GA3341@krava.brq.redhat.com> References: <20150408174510.GA20250@krava.redhat.com> <1428566160-17912-1-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428566160-17912-1-git-send-email-hekuang@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1832 Lines: 63 On Thu, Apr 09, 2015 at 03:56:00PM +0800, He Kuang wrote: > 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 Acked-by: Jiri Olsa thanks, jirka > --- > 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 7a12047..de80ded 100644 > --- a/tools/perf/util/data-convert-bt.c > +++ b/tools/perf/util/data-convert-bt.c > @@ -896,6 +896,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", > @@ -906,11 +908,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; > } > -- > 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/