Re: [PATCH v2 3/5] perf pmu: Rename name matching for no suffix or wildcard variants

Ian Rogers
2025-02-01T07:31:07Z

On Thu, Jan 30, 2025 at 11:29 AM Liang, Kan <kan.liang@linux.intel.com> wrote:
> On 2025-01-23 2:46 a.m., Ian Rogers wrote:
[ snip ]
> > /**
> > - * pmu_uncore_alias_match - does name match the PMU name?
> > - * @pmu_name: the json struct pmu_event name. This may lack a suffix (which
> > + * perf_pmu__match_ignoring_suffix_uncore - Does the pmu_name match tok ignoring
> > + * any trailing suffix on pmu_name and
> > + * tok? The Suffix must be in form
> > + * tok_{digits}, or tok{digits}.
> > + * @pmu_name: The pmu_name with possible suffix.
> > + * @tok: The possible match to pmu_name.
> > + */
> > +static bool perf_pmu__match_ignoring_suffix_uncore(const char *pmu_name, const char *tok)
> > +{
> > + size_t pmu_name_len, tok_len;
> > +
>
> if (!pmu_name)
> return false;
>
> I got a segmentfault when I try the code because of a NULL pmu_name.

Thanks for testing! I'll add the extra check. I think it may be
redundant with other event parsing changes that aren't merged in the
main tree.

Ian