Re: [PATCH] perf jevents: Fix sys_event_tables to be freed like arch_std_events

From: Arnaldo Carvalho de Melo
Date: Tue Sep 28 2021 - 08:37:41 EST


Em Tue, Sep 28, 2021 at 07:53:54PM +0800, Like Xu escreveu:
> On 28/9/2021 7:52 pm, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Sep 28, 2021 at 06:29:38PM +0800, Like Xu escreveu:
> > > From: Like Xu <likexu@xxxxxxxxxxx>
> > >
> > > The compiler reports that free_sys_event_tables() is dead code. But
> > > according to the semantics, the "LIST_HEAD(arch_std_events)" should
> Sorry, s/arch_std_events/sys_event_tables/, please --amend.

sure

> > > also be released, just like we do with 'arch_std_events' in the main().
> >
> > Thanks, applied.
> >
> > - Arnaldo
> >
> > > Fixes: e9d32c1bf0cd7a98 ("perf vendor events: Add support for arch standard events")
> > > Signed-off-by: Like Xu <likexu@xxxxxxxxxxx>
> > > ---
> > > tools/perf/pmu-events/jevents.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> > > index 6731b3cf0c2f..7c887d37b893 100644
> > > --- a/tools/perf/pmu-events/jevents.c
> > > +++ b/tools/perf/pmu-events/jevents.c
> > > @@ -1285,6 +1285,7 @@ int main(int argc, char *argv[])
> > > }
> > > free_arch_std_events();
> > > + free_sys_event_tables();
> > > free(mapfile);
> > > return 0;
> > > @@ -1306,6 +1307,7 @@ int main(int argc, char *argv[])
> > > create_empty_mapping(output_file);
> > > err_out:
> > > free_arch_std_events();
> > > + free_sys_event_tables();
> > > free(mapfile);
> > > return ret;
> > > }
> > > --
> > > 2.32.0
> >

--

- Arnaldo