Re: [PATCH] perf/core: move all of the pmu devices into their own location

From: Ian Rogers
Date: Tue Feb 04 2025 - 12:50:16 EST


On Tue, Feb 4, 2025 at 9:12 AM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Feb 04, 2025 at 11:41:38AM -0500, Vince Weaver wrote:
> > On Tue, 4 Feb 2025, Greg Kroah-Hartman wrote:
> >
> > >
> > > It seems that the majority of the perf code IS looking in the correct
> > > place, just mem-events.c seemed wrong.
> >
> > I hate to tell you, but other places in userspace are depending on the
> > current setup. libpfm4, used by PAPI, is looking directly in /sys/devices
> > for pmus and will break with the changes you are planning.
>
> Then that too needs to be fixed, sorry. Again, devices can, and will,
> move around in /sys/devices/ you can never hard-code any paths there.
> Any userspace code must ALWAYS be able to handle that, that's a sysfs
> requirement.
>
> And do you have a link to the source for that code? Good news is that
> if the code is fixed in userspace, it will work for any kernel (old or
> new).

+Stephane Eranian

I see use of /sys/devices in at least:
https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/lib/pfmlib_perf_event_pmu.c
I imagine it isn't a big job to clean it up.

Thanks,
Ian