Re: [PATCH 1/1] perf evsel: Introduce evsel__name_is() method to check if the evsel name is equal to a given string

From: Arnaldo Carvalho de Melo
Date: Thu Apr 20 2023 - 15:28:31 EST


Em Thu, Apr 20, 2023 at 04:10:30PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Apr 20, 2023 at 03:57:55PM -0300, Arnaldo Carvalho de Melo escreveu:
> > This makes the logic a bit clear by avoiding the !strcmp() pattern and
> > also a way to intercept the pointer if we need to do extra validation on
> > it or to do lazy setting of evsel->name via evsel__name(evsel).
>
> + this, looking if there are others...

Somehow the first message didn't go thru, so below is the combined
patch, this is an effort to avoid accessing evsel->name directly as the
preferred way to get an evsel name is evsel__name(), so looking for
direct access and providing accessors that avoid that.

- Arnaldo