From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: taeung <treeze.taeung@gmail.com>
Cc: linux-kernel@vger.kernel.org, jolsa@redhat.com,
namhyung@kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v2 4/5] perf mem: Fill in the missing freeing a session after an error occur
Date: Wed, 1 Jul 2015 11:42:42 -0300 [thread overview]
Message-ID: <20150701144242.GB8882@kernel.org> (raw)
In-Reply-To: <5593736F.7050506@gmail.com>
Em Wed, Jul 01, 2015 at 01:58:23PM +0900, taeung escreveu:
> On 07/01/2015 04:57 AM, Arnaldo Carvalho de Melo wrote:
> >Em Wed, Jul 01, 2015 at 12:18:45AM +0900, Taeung Song escreveu:
> >>@@ -135,24 +134,23 @@ static int report_raw_events(struct perf_mem *mem)
> >> if (mem->cpu_list) {
> >> ret = perf_session__cpu_bitmap(session, mem->cpu_list,
> >> mem->cpu_bitmap);
> >>- if (ret)
> >>+ if (ret) {
> >>+ ret = -EINVAL;
> >Why not propagate perf_session__cpu_bitmap() return, this function
> >wasn't being consistent in returning errors, neither was you, as, see
> >below...
> perf_session__cpu_bitmap()
> when an error occurs in this function, a error value which is -1 is returned.
> Therefore, this conditional sentence 'if (ret)' have to be changed to 'if (ret < 0)' as below.
>
> - if (ret)
> + if (ret < 0)
> goto out_delete;
>
> Is it what you say ?
No, the above change is not related to what I mentioned, it is harmless
albeit not needed, what I mentioned was about the part just after the
if:
if (ret) {
ret = -EINVAL; <---------------- This one
But I see you removed that from your latest change, so all is fine now,
I think.
- Arnaldo
>
> --
> Thanks,
> Taeung
>
> >
> >> goto out_delete;
> >>+ }
> >> }
> >>- if (symbol__init(&session->header.env) < 0)
> >>- return -1;
> >>+ ret = symbol__init(&session->header.env);
> >>+ if (ret < 0)
> >>+ goto out_delete;
> >Here you decided to propagate symbol__init() error return. :-)
> >
> >I applied all the others, including the 3/5 v2 one.
> >
> >Thanks,
> >
> >- Arnaldo
> >
> >> printf("# PID, TID, IP, ADDR, LOCAL WEIGHT, DSRC, SYMBOL\n");
> >>- err = perf_session__process_events(session);
> >>- if (err)
> >>- return err;
> >>-
> >>- return 0;
> >>+ ret = perf_session__process_events(session);
> >> out_delete:
> >> perf_session__delete(session);
> >>- return err;
> >>+ return ret;
> >> }
> >> static int report_events(int argc, const char **argv, struct perf_mem *mem)
> >>--
> >>1.9.1
next prev parent reply other threads:[~2015-07-01 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 15:18 [PATCH v2 3/5] perf kvm: Fill in the missing freeing a session after an error occur Taeung Song
2015-06-30 15:18 ` [PATCH v2 4/5] perf mem: " Taeung Song
2015-06-30 19:57 ` Arnaldo Carvalho de Melo
2015-07-01 4:58 ` taeung
2015-07-01 14:42 ` Arnaldo Carvalho de Melo [this message]
2015-07-03 7:49 ` [tip:perf/urgent] perf kvm: Fill in the missing session freeing after an error occurs tip-bot for Taeung Song
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=20150701144242.GB8882@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=treeze.taeung@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.