Re: [PATCH v8 2/4] libperf: Add evsel mmap support

From: Rob Herring
Date: Thu Apr 15 2021 - 16:09:43 EST


On Thu, Apr 15, 2021 at 2:37 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Thu, Apr 15, 2021 at 04:14:31AM +0900, Namhyung Kim escreveu:
> > On Thu, Apr 15, 2021 at 3:23 AM Arnaldo Carvalho de Melo
> > <acme@xxxxxxxxxx> wrote:
> > >
> > > Em Wed, Apr 14, 2021 at 03:02:08PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > > Em Thu, Apr 15, 2021 at 01:41:35AM +0900, Namhyung Kim escreveu:
> > > > > Hello,
> > > > >
> > > > > On Thu, Apr 15, 2021 at 1:07 AM Rob Herring <robh@xxxxxxxxxx> wrote:
> > > > > > +void *perf_evsel__mmap_base(struct perf_evsel *evsel, int cpu, int thread)
> > > > > > +{
> > > > > > + if (FD(evsel, cpu, thread) < 0 || MMAP(evsel, cpu, thread) == NULL)
> > > > > > + return NULL;
> > > > >
> > > > > I think you should check the cpu and the thread is in
> > > > > a valid range. Currently xyarray__entry() simply accesses
> > > > > the content without checking the boundaries.
> > > >
> > > > So, since xyarray has the bounds, it should check it, i.e. we need to
> > > > have a __xyarray__entry() that is what xyarray__entry() does, i.e.
> > > > assume the values have been bounds checked, then a new method,
> > > > xyarray__entry() that does bounds check, if it fails, return NULL,
> > > > otherwise calls __xyarray__entry().
> > > >
> > > > I see this is frustrating and I should've chimed in earlier, but at
> > > > least now this is getting traction, and the end result will be better
> > > > not just for the feature you've been dilligently working on,
> > > >
> > > > Thank you for your persistence,
> > >
> > > Re-reading, yeah, this can be done in a separate patch, Namhyung, can I
> > > have your Reviewed-by? That or an Acked-by?
> >
> > Sure, for the series:
> >
> > Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
>
> Ok, b4 failed on it, probably some missing Reply to, so I'll apply it by
> hand:

That's my fault. A duplicate message-id is the issue. git-send-email
died after patch 1/4 (can't say I've ever had that happen). So in my
attempt to manually resend 2-4, I was off by 1 in the message-id and
duplicated patch 1's message-id. I should have just resent the whole
thing.

Rob