[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97541134-7c32-94a8-7642-a82f3292dc38@maine.edu>
Date: Tue, 4 Feb 2025 20:21:17 -0500 (EST)
From: Vince Weaver <vincent.weaver@...ne.edu>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
cc: Ian Rogers <irogers@...gle.com>, Stephane Eranian <eranian@...gle.com>,
Vince Weaver <vincent.weaver@...ne.edu>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>,
Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH] perf/core: move all of the pmu devices into their own
location
On Tue, 4 Feb 2025, Greg Kroah-Hartman wrote:
> On Tue, Feb 04, 2025 at 09:49:55AM -0800, Ian Rogers wrote:
> > On Tue, Feb 4, 2025 at 9:12 AM Greg Kroah-Hartman
> > <gregkh@...uxfoundation.org> 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.
>
> Nope, all that has to happen is this line:
> snprintf(buf, PATH_MAX, "/sys/devices/%s/events/%s", e->pmu ? e->pmu : "cpu", e->name);
> be changed to:
> snprintf(buf, PATH_MAX, "/sys/bus/event_source/devices/%s/events/%s", e->pmu ? e->pmu : "cpu", e->name);
it doesn't matter if it's a one line change, your proposed change breaks
userspace.
I thought the rule was Linux didn't break userspace.
Has that changed recently?
libpfm4/PAPI are widely used and deployed and in some cases possibly
statically linked into other projects. It will take years for the change
to filter out to all users.
Is there a technical reason for this proposed change of yours, or are you
just arbitrarily breaking userspace programs because you think /sys looks
cluttered to your personal taste?
Vince Weaver
vincent.weaver@...ne.edu
Powered by blists - more mailing lists