Re: [PATCH 23/24] perf buildid-list: Add support for mmap2's buildid events

From: Jiri Olsa
Date: Tue Nov 17 2020 - 10:22:06 EST


On Tue, Nov 17, 2020 at 09:50:40AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 17, 2020 at 12:00:52PM +0100, Jiri Olsa escreveu:
> > Add buildid-list support for mmap2's build id data, so we can
> > display build ids for dso objects for data without the build
> > id cache update.
>
> > $ perf buildid-list
> > 1805c738c8f3ec0f47b7ea09080c28f34d18a82b /usr/lib64/ld-2.31.so
> > d278249792061c6b74d1693ca59513be1def13f2 /usr/lib64/libc-2.31.so
> >
> > By default only dso objects with hits are shown.
>
> Would be interesting to be able to show all the build ids that are
> there. a 'perf buildid-list --all' or make this under --force?

ok, will check.. one other tool I think would be handy is
to show which debuginfo is not available, because it can
change the report a lot - missing symbols are not getting
accounted, and their hits are accounted only as separated
addresses

jirka

>
> - Arnaldo
>
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > ---
> > tools/perf/builtin-buildid-list.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
> > index e3ef75583514..87f5b1a4a7fa 100644
> > --- a/tools/perf/builtin-buildid-list.c
> > +++ b/tools/perf/builtin-buildid-list.c
> > @@ -77,6 +77,9 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
> > perf_header__has_feat(&session->header, HEADER_AUXTRACE))
> > with_hits = false;
> >
> > + if (!perf_header__has_feat(&session->header, HEADER_BUILD_ID))
> > + with_hits = true;
> > +
> > /*
> > * in pipe-mode, the only way to get the buildids is to parse
> > * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID
> > --
> > 2.26.2
> >
>
> --
>
> - Arnaldo
>