Re: [PATCH v4 10/17] perf pmu-events: Hide pmu_events_map

From: John Garry
Date: Thu Aug 11 2022 - 10:47:44 EST


On 10/08/2022 15:29, Ian Rogers wrote:
_args.output_file.write("""{
@@ -389,6 +409,61 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = {
\t},
};

+const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu)
+{
+ const struct pmu_event *table = NULL;
+ char *cpuid = perf_pmu__getcpuid(pmu);
This seems an identical implementation to that in empty-pmu-events.c -
can we reduce this duplication? Maybe a seperate common c file which can
be linked in

The indentation seems different also - this version seems to use whitespaces
Agreed. Later on this will change, the empty version isn't compressed
and the jevents.py one is. Having a common C file would defeat the
goal of hiding the API, but ultimately we'd need to get rid of it in
later changes when the empty/compressed implementations diverge.

ok, I suppose.. I have to say that this divergence is less then ideal and I don't so like much all the difference in pmu-events/pmu-events.c and pmu-events/empty-pmu-events.c

thanks,
John