All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] perf inject: Fix --buildid-all not to eat up MMAP2
Date: Thu, 23 Feb 2023 10:31:57 -0300	[thread overview]
Message-ID: <Y/dqzbHTVWlWRZoJ@kernel.org> (raw)
In-Reply-To: <20230223070155.54251-1-namhyung@kernel.org>

Em Wed, Feb 22, 2023 at 11:01:55PM -0800, Namhyung Kim escreveu:
> When MMAP2 has PERF_RECORD_MISC_MMAP_BUILD_ID flag, it means the record
> already has the build-id info.  So it marks the DSO as hit, to skip if
> the same DSO is not processed if it happens to miss the build-id later.
> 
> But it missed to copy the MMAP2 record itself so it'd fail to symbolize
> samples for those regions.

Thanks, applied.

- Arnaldo

 
> For example, the following generates 249 MMAP2 events.
> 
>   $ perf record --buildid-mmap -o- true | perf report --stat -i- | grep MMAP2
>            MMAP2 events:        249  (86.8%)
> 
> Adding perf inject should not change the number of events like this
> 
>   $ perf record --buildid-mmap -o- true | perf inject -b | \
>   > perf report --stat -i- | grep MMAP2
>            MMAP2 events:        249  (86.5%)
> 
> But when --buildid-all is used, it eats most of the MMAP2 events.
> 
>   $ perf record --buildid-mmap -o- true | perf inject -b --buildid-all | \
>   > perf report --stat -i- | grep MMAP2
>            MMAP2 events:          1  ( 2.5%)
> 
> With this patch, it shows the original number now.
> 
>   $ perf record --buildid-mmap -o- true | perf inject -b --buildid-all | \
>   > perf report --stat -i- | grep MMAP2
>            MMAP2 events:        249  (86.5%)
> 
> Cc: stable@vger.kernel.org
> Fixes: f7fc0d1c915a ("perf inject: Do not inject BUILD_ID record if MMAP2 has it")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/builtin-inject.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index f8182417b734..10bb1d494258 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -538,6 +538,7 @@ static int perf_event__repipe_buildid_mmap2(struct perf_tool *tool,
>  			dso->hit = 1;
>  		}
>  		dso__put(dso);
> +		perf_event__repipe(tool, event, sample, machine);
>  		return 0;
>  	}
>  
> -- 
> 2.39.2.637.g21b0678d19-goog
> 

-- 

- Arnaldo

      reply	other threads:[~2023-02-23 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  7:01 [PATCH] perf inject: Fix --buildid-all not to eat up MMAP2 Namhyung Kim
2023-02-23 13:31 ` 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=Y/dqzbHTVWlWRZoJ@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.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.