All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: kajoljain <kjain@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	eranian@google.com
Subject: Re: [PATCH v2] perf bpf: Fix memory leaks relating to BTF.
Date: Mon, 30 Aug 2021 18:29:24 -0300	[thread overview]
Message-ID: <YS1NtCLgQzB7GILt@kernel.org> (raw)
In-Reply-To: <767e90d9-fb3e-93e2-ac67-940ab7e9ae28@linux.ibm.com>

Em Fri, Aug 27, 2021 at 12:58:09PM +0530, kajoljain escreveu:
> Patch looks good me.
> 
> Reviewed-by: Kajol Jain<kjain@linux.ibm.com>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Kajol Jain
> 
> On 8/27/21 12:18 AM, Ian Rogers wrote:
> > BTF needs to be freed with btf__free.
> > 
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> >  tools/perf/util/annotate.c  | 2 +-
> >  tools/perf/util/bpf-event.c | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> > index d43f6b5e5169..0bae061b2d6d 100644
> > --- a/tools/perf/util/annotate.c
> > +++ b/tools/perf/util/annotate.c
> > @@ -1833,7 +1833,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> >  	ret = 0;
> >  out:
> >  	free(prog_linfo);
> > -	free(btf);
> > +	btf__free(btf);
> >  	fclose(s);
> >  	bfd_close(bfdf);
> >  	return ret;
> > diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
> > index cdecda1ddd36..17a9844e4fbf 100644
> > --- a/tools/perf/util/bpf-event.c
> > +++ b/tools/perf/util/bpf-event.c
> > @@ -296,7 +296,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,
> >  
> >  out:
> >  	free(info_linear);
> > -	free(btf);
> > +	btf__free(btf);
> >  	return err ? -1 : 0;
> >  }
> >  
> > @@ -486,7 +486,7 @@ static void perf_env__add_bpf_info(struct perf_env *env, u32 id)
> >  	perf_env__fetch_btf(env, btf_id, btf);
> >  
> >  out:
> > -	free(btf);
> > +	btf__free(btf);
> >  	close(fd);
> >  }
> >  
> > 

-- 

- Arnaldo

      reply	other threads:[~2021-08-30 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 18:48 [PATCH v2] perf bpf: Fix memory leaks relating to BTF Ian Rogers
2021-08-27  7:28 ` kajoljain
2021-08-30 21:29   ` Arnaldo Carvalho de Melo [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=YS1NtCLgQzB7GILt@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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.