Re: [PATCH v1] perf jevents: Autogenerate empty-pmu-events.c

From: Ian Rogers
Date: Tue May 21 2024 - 13:13:31 EST


On Tue, May 21, 2024 at 4:45 AM John Garry <john.g.garry@xxxxxxxxxx> wrote:
>
> On 20/05/2024 16:36, Ian Rogers wrote:
> > }
> > + ret = pmu_events_table__find_event_pmu(table, table_pmu, name, fn, data);
> > + if (ret != -1000)
> > + return ret;
> > + }
> > return -1000;
>
> what's -1000 meaning? It would be nice to use some standard error codes.

This is a pre-existing thing. 0 means continue and anything else
generally aborts a search, -1000 is used when searching multiple
tables to indicate not found in 1 table but potentially not all.

Commit 3d5045492ab2 ("perf pmu-events: Add
pmu_events_table__find_event()") added this [1], you were on the cc
list ;-) I think moving to a named constant would make this more
intention revealing so I'll add this to a v2 set.

Thanks,
Ian

[1] https://lore.kernel.org/r/20230824041330.266337-9-irogers@xxxxxxxxxx

> Thanks,
> John
>
>