Re: [PATCH 15/26] perf tools: Synthesize proc tasks with mmap3

From: Jiri Olsa
Date: Mon Sep 14 2020 - 16:52:21 EST


On Mon, Sep 14, 2020 at 01:07:38PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Sun, Sep 13, 2020 at 11:03:02PM +0200, Jiri Olsa escreveu:
> > Synthesizing proc tasks with mmap3 events so we can
> > get build id data for synthesized maps as well.
> >
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > ---
> > tools/perf/util/mmap.c | 2 +-
> > tools/perf/util/synthetic-events.c | 72 +++++++++++++++++-------------
> > 2 files changed, 43 insertions(+), 31 deletions(-)
> >
> > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
> > index ab7108d22428..51f6f86580a9 100644
> > --- a/tools/perf/util/mmap.c
> > +++ b/tools/perf/util/mmap.c
> > @@ -33,7 +33,7 @@ void mmap_cpu_mask__scnprintf(struct mmap_cpu_mask *mask, const char *tag)
> >
> > len = bitmap_scnprintf(mask->bits, mask->nbits, buf, MASK_SIZE);
> > buf[len] = '\0';
> > - pr_debug("%p: %s mask[%zd]: %s\n", mask, tag, mask->nbits, buf);
> > + pr_debug2("%p: %s mask[%zd]: %s\n", mask, tag, mask->nbits, buf);
> > }
>
> Can this be in a separate patch?

ok

>
> > size_t mmap__mmap_len(struct mmap *map)
> > diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
> > index 89b390623b63..bd6e7b84283d 100644
> > --- a/tools/perf/util/synthetic-events.c
> > +++ b/tools/perf/util/synthetic-events.c
> > @@ -379,7 +379,7 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
> > }
> > io__init(&io, io.fd, bf, sizeof(bf));
> >
> > - event->header.type = PERF_RECORD_MMAP2;
> > + event->header.type = PERF_RECORD_MMAP3;
>
> This also needs to check if the user is interested in build-id records.
> If it is disabled, then using this new tool with mmap3 support will
> generate perf.data files that will bot be grokked by older tools,
> introducing an annoyance for people not interested in build-ids.

ok, this should disappear with if we stay with mmap2
and do that union stuff

thanks,
jirka