Re: [PATCH v1 5/5] perf record: Make --buildid-mmap the default

From: Arnaldo Carvalho de Melo
Date: Fri Apr 25 2025 - 10:45:44 EST


On Thu, Apr 24, 2025 at 12:20:44AM -0700, Ian Rogers wrote:
> On Wed, Apr 23, 2025 at 11:19 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> > @@ -1795,7 +1796,8 @@ record__finish_output(struct record *rec)
> > data->dir.files[i].size = lseek(data->dir.files[i].fd, 0, SEEK_CUR);
> > }
> >
> > - if (!rec->no_buildid) {
> > + /* Buildid scanning disabled or build ID in kernel and synthesized map events. */
> > + if (!rec->no_buildid && !rec->buildid_mmap) {

> So I think this is wrong. It matches current behaviors, but it is
> wrong. If we don't process the kernel's mmap events the DSOs won't be
> loaded and the build ID cache won't contain the DSOs. There is also
> the bug that the sample processing to find maps to find DSOs, doesn't
> handle call chains. Given the broken nature of the build ID cache I'm
> not sure it makes any sense for perf record to be by default
> populating it. I think it probably makes sense to consider the default
> population a legacy feature and make -N the default along with
> --buildid-mmap.

The first four patches are good fixes/cleanups, so I'm picking them, ok?

- Arnaldo