public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@linux.intel.com>, Ian Rogers <irogers@google.com>
Subject: Re: [PATCH 1/2] perf inject: Call dso__put() even if dso->hit is set
Date: Wed, 26 May 2021 14:13:43 +0200	[thread overview]
Message-ID: <YK47d3S4wGIr3lu6@krava> (raw)
In-Reply-To: <20210524225051.1190486-1-namhyung@kernel.org>

On Mon, May 24, 2021 at 03:50:50PM -0700, Namhyung Kim wrote:
> Otherwise it'll leak the refcount for the DSO.  As dso__put() can
> handle a NULL dso pointer, we can just call it unconditionally.
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

for the patchset

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/perf/builtin-inject.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index 102cafb0c0b3..8bbaa46eb7e6 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -383,8 +383,8 @@ static int perf_event__repipe_buildid_mmap(struct perf_tool *tool,
>  	if (dso && !dso->hit) {
>  		dso->hit = 1;
>  		dso__inject_build_id(dso, tool, machine, sample->cpumode, 0);
> -		dso__put(dso);
>  	}
> +	dso__put(dso);
>  
>  	return perf_event__repipe(tool, event, sample, machine);
>  }
> @@ -447,8 +447,8 @@ static int perf_event__repipe_buildid_mmap2(struct perf_tool *tool,
>  		dso->hit = 1;
>  		dso__inject_build_id(dso, tool, machine, sample->cpumode,
>  				     event->mmap2.flags);
> -		dso__put(dso);
>  	}
> +	dso__put(dso);
>  
>  	perf_event__repipe(tool, event, sample, machine);
>  
> -- 
> 2.31.1.818.g46aad6cb9e-goog
> 


  parent reply	other threads:[~2021-05-26 12:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 22:50 [PATCH 1/2] perf inject: Call dso__put() even if dso->hit is set Namhyung Kim
2021-05-24 22:50 ` [PATCH 2/2] perf inject: Do not inject BUILD_ID record if MMAP2 has it Namhyung Kim
2021-05-26 12:13 ` Jiri Olsa [this message]
2021-05-26 12:39   ` [PATCH 1/2] perf inject: Call dso__put() even if dso->hit is set Arnaldo Carvalho de Melo

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=YK47d3S4wGIr3lu6@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox