mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Wangnan (F)" <wangnan0@huawei.com>
Cc: "Jiri Olsa" <jolsa@kernel.org>,
	acme@redhat.com, linux-kernel@vger.kernel.org,
	"Jérémie Galarneau" <jeremie.galarneau@efficios.com>,
	"Zefan Li" <lizefan@huawei.com>,
	pi3orama@163.com
Subject: Re: [PATCH] perf data: Fix releasing event_class
Date: Thu, 28 Jan 2016 10:26:39 +0100	[thread overview]
Message-ID: <20160128092639.GE2322@krava.brq.redhat.com> (raw)
In-Reply-To: <56A9D887.8030508@huawei.com>

On Thu, Jan 28, 2016 at 04:59:51PM +0800, Wangnan (F) wrote:
> Hi Jiri, What's your opinion on this patch?

> 
> Thank you.
> 
> On 2016/1/27 19:21, Wang Nan wrote:
> >A new patch of libbabeltrace [1] reveals a object leak problem in
> >perf data CTF support: perf code never release event_class which is
> >allocated in add_event() and stored in evsel's private field.
> >
> >If libbabeltrace has the above patch applied, leaking event_class
> >prevent writer being destroied and flushing metadata. For example:

oops, missed this one.. sry.. nice feature ;-)

> >
> >  $ ./perf record ls
> >  Lowering default frequency rate to 500.
> >  Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
> >  perf.data
> >  [ perf record: Woken up 1 times to write data ]
> >  [ perf record: Captured and wrote 0.012 MB perf.data (12 samples) ]
> >  $ ./perf data convert --to-ctf ./out.ctf
> >  [ perf data convert: Converted 'perf.data' into CTF data './out.ctf' ]
> >  [ perf data convert: Converted and wrote 0.000 MB (12 samples) ]
> >  $ cat ./out.ctf/metadata
> >  $ ls -l  ./out.ctf/metadata
> >  -rw-r----- 1 w00229757 mm 0 Jan 27 10:49 ./out.ctf/metadata

SNIP

> >+static void cleanup_events(struct perf_session *session)
> >+{
> >+	struct perf_evlist *evlist = session->evlist;
> >+	struct perf_evsel *evsel;
> >+
> >+	evlist__for_each(evlist, evsel) {
> >+		struct evsel_priv *priv;
> >+
> >+		priv = evsel->priv;
> >+		bt_ctf_event_class_put(priv->event_class);

right, we missed that.. but we should also call free(priv) then

also I can't see also perf_evlist__delete being called..
not sure perf_session__delete will take care of that

thanks,
jirka

  reply	other threads:[~2016-01-28  9:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 11:21 Wang Nan
2016-01-28  8:59 ` Wangnan (F)
2016-01-28  9:26   ` Jiri Olsa [this message]
2016-01-28 13:20     ` [PATCH v2] " Wang Nan
2016-01-28 14:59       ` Jiri Olsa
2016-01-28 19:09         ` Arnaldo Carvalho de Melo
2016-01-28 19:42           ` 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=20160128092639.GE2322@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=jeremie.galarneau@efficios.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=pi3orama@163.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

all inboxes | Powered by JetHome®