From: Jiri Olsa <jolsa@redhat.com>
To: He Kuang <hekuang@huawei.com>
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
Date: Thu, 9 Apr 2015 11:45:21 +0200 [thread overview]
Message-ID: <20150409094521.GA3341@krava.brq.redhat.com> (raw)
In-Reply-To: <1428566160-17912-1-git-send-email-hekuang@huawei.com>
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 <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
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
>
next prev parent reply other threads:[~2015-04-09 9:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 4:49 [PATCH 1/2] perf data: Show error message when ctf setup failed He Kuang
2015-04-08 4:49 ` [PATCH 2/2] perf data: Fix ctf_writer setupenv failure He Kuang
2015-04-08 17:59 ` Jiri Olsa
2015-04-09 7:38 ` He Kuang
2015-04-09 19:57 ` Jérémie Galarneau
2015-04-10 7:39 ` He Kuang
2015-04-10 12:38 ` Jiri Olsa
2015-04-08 17:45 ` [PATCH 1/2] perf data: Show error message when ctf setup failed Jiri Olsa
2015-04-09 7:56 ` [PATCHv2 1/2] perf data: Show error message when conversion failed He Kuang
2015-04-09 9:45 ` Jiri Olsa [this message]
2015-04-18 14:00 ` Jiri Olsa
2015-04-09 8:19 ` [PATCH 1/2] perf data: Show error message when ctf setup failed He Kuang
2015-04-09 9:46 ` Jiri Olsa
2015-04-09 14:37 ` Alexandre Montplaisir
2015-04-10 12:05 ` Jiri Olsa
2015-04-10 12:37 ` Jiri Olsa
2015-04-13 20:30 ` Jérémie Galarneau
2015-04-14 17:47 ` Jérémie Galarneau
2015-04-18 13:58 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150409094521.GA3341@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=hekuang@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome