Re: [PATCH v3] perf evlist: Fix evlist__new_default() for > 1 core PMU

From: Namhyung Kim
Date: Fri Jan 26 2024 - 15:50:09 EST


On Fri, Jan 26, 2024 at 8:25 AM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Wed, Jan 24, 2024 at 09:03:57AM +0000, James Clark escreveu:
> > On 24/01/2024 00:46, Namhyung Kim wrote:
> > > On Tue, Jan 23, 2024 at 2:39 AM James Clark <james.clark@xxxxxxx> wrote:
> > >> +++ b/tools/perf/util/evlist.c
> > >> @@ -106,6 +106,13 @@ struct evlist *evlist__new_default(void)
> > >> evlist = NULL;
> > >> }
>
> > >> + if (evlist->core.nr_entries > 1) {
>
> > > I think you need a NULL check for evlist here.
>
> > Oops yes. Or just return on the error above.
>
> Was there a v4?

https://lore.kernel.org/linux-perf-users/20240124094358.489372-1-james.clark@xxxxxxx/

> I'm assuming this is for perf-tools, i.e. for v6.8-rc, right?

It fixes 251aa040244a which is added to v6.5. So I applied it
to perf-tools-next, do you want to take it to perf-tools?

Thanks,
Namhyung