Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932454AbbDIIUS (ORCPT ); Thu, 9 Apr 2015 04:20:18 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:24521 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbbDIIUM (ORCPT ); Thu, 9 Apr 2015 04:20:12 -0400 Message-ID: <55263608.2070301@huawei.com> Date: Thu, 9 Apr 2015 16:19:20 +0800 From: He Kuang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Jiri Olsa CC: , , , , , , Subject: Re: [PATCH 1/2] perf data: Show error message when ctf setup failed References: <1428468560-27401-1-git-send-email-hekuang@huawei.com> <20150408174510.GA20250@krava.redhat.com> In-Reply-To: <20150408174510.GA20250@krava.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.110.54.65] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2360 Lines: 79 Hi, jirka On 2015/4/9 1:45, Jiri Olsa wrote: > On Wed, Apr 08, 2015 at 12:49:19PM +0800, He Kuang wrote: >> 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. > so I have like 5 more patches from the original CTF set > which I'm holding until all works with tracecompass: > http://marc.info/?l=linux-kernel&m=142736197610573&w=2 > > Is it working for you? How do you test resulted CTF data? > > anyway the patch looks ok, just small nit below I tested by using babeltrace binary and it works. After receiving your reply, I test on the latest tracecompass. A folder named 'ctf' is showed instead of the expected file 'ctf-data', this folder only contains the raw metadata and perf-stream files but not analysed. >> 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); >> + > this leg can also fail due to: > > err = perf_session__process_events(session); > if (!err) > err = bt_ctf_stream_flush(cw->stream); > > > so we might want to inform about that like: > if (err) > pr_err("Error during conversion.\n"); > > > thanks, > jirka > >> + 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/