From: Leo Yan <leo.yan@linaro.org>
To: "liwei (GF)" <liwei391@huawei.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Kim Phillips <kim.phillips@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 2/2] perf tools: Fix record failure when mixed with ARM SPE event
Date: Sun, 5 Jul 2020 13:24:14 +0800 [thread overview]
Message-ID: <20200705052414.GC14142@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <5d872f6f-3665-5abd-7251-13926a70f793@huawei.com>
On Fri, Jul 03, 2020 at 12:06:15PM +0800, liwei (GF) wrote:
[...]
Thanks for Mathieu's looping and agreed with his comments.
> > Last but not least do you know where the memory allocated for array arm_spe_pmus
> > is released? If you can't find it either then we have a memory leak and it
> > would be nice to have that fixed.
>
> Yes, we have a memory leak here indeed, i forgot to free it in this function.
> As 'arm_spe_pmus' is defined as static, i think the author meant to assign it only at the first call,
> but this function is only called once when we executing 'record', should i go on fixing it
> or just drop the patch 1?
I personally think patch 1 is reasonable. So for fixing memory leak,
I did a quick check, it's good to release the array "arm_spe_pmus" in
the function auxtrace_record__init(), since the array is only used in
this function.
Thanks,
Leo
prev parent reply other threads:[~2020-07-05 5:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 12:31 [PATCH 0/2] perf tools: Fix record failure when mixed with ARM SPE event Wei Li
2020-06-23 12:31 ` [PATCH 1/2] perf tools: ARM SPE code cleanup Wei Li
2020-07-02 22:39 ` Mathieu Poirier
2020-07-05 5:05 ` Leo Yan
2020-06-23 12:31 ` [PATCH 2/2] perf tools: Fix record failure when mixed with ARM SPE event Wei Li
2020-07-02 23:03 ` Mathieu Poirier
2020-07-03 4:06 ` liwei (GF)
2020-07-05 5:24 ` Leo Yan [this message]
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=20200705052414.GC14142@leoy-ThinkPad-X240s \
--to=leo.yan@linaro.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=kim.phillips@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=suzuki.poulose@arm.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;
as well as URLs for NNTP newsgroup(s).