Hi James,

On Tue, Sep 01, 2020 at 04:52:54PM +0100, James Clark wrote:
> Hi Leo,
> 
> >  
> > +static int process_attr(struct perf_tool *tool __maybe_unused,
> > +                   union perf_event *event,
> > +                   struct evlist **pevlist)
> > +{
> > +   int err;
> > +
> > +   err = perf_event__process_attr(tool, event, pevlist);
> > +   if (err)
> > +           return err;
> > +
> > +   return 0;
> > +}
> > +
> >  int cmd_mem(int argc, const char **argv)
> >  {
> >     struct stat st;
> > @@ -405,8 +430,12 @@ int cmd_mem(int argc, const char **argv)
> >                     .comm           = perf_event__process_comm,
> >                     .lost           = perf_event__process_lost,
> >                     .fork           = perf_event__process_fork,
> > +                   .attr           = process_attr,
> >                     .build_id       = perf_event__process_build_id,
> 
> I don't understand the __maybe_unused here. And also isn't this equivalent
> to this without the new function:
> 
>   @@ -405,8 +430,12 @@ int cmd_mem(int argc, const char **argv)
>                       .comm           = perf_event__process_comm,
>                       .lost           = perf_event__process_lost,
>                       .fork           = perf_event__process_fork,
>   +                   .attr           = perf_event__process_attr,
>                       .build_id       = perf_event__process_build_id,

Thanks for pointing out this, will fix this with your suggestion.

Thanks,
Leo

Reply via email to