All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>,
	Vince Weaver <vincent.weaver@maine.edu>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH] perf/core: move all of the pmu devices into their own location
Date: Tue, 4 Feb 2025 19:03:30 +0100	[thread overview]
Message-ID: <2025020444-savage-latrine-0c31@gregkh> (raw)
In-Reply-To: <CAP-5=fWT5J0svFsA-jqvE4P=NnTdrsKPF9x6JHkUEDp-vBd_1w@mail.gmail.com>

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@linuxfoundation.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);


thanks,

greg k-h

  reply	other threads:[~2025-02-04 18:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 19:25 [PATCH] perf/core: move all of the pmu devices into their own location Greg Kroah-Hartman
2025-02-03 19:44 ` Ian Rogers
2025-02-04  7:05   ` Greg Kroah-Hartman
2025-02-04 18:17     ` Ian Rogers
2025-02-05  5:41       ` Greg Kroah-Hartman
2025-02-05 16:48         ` Ian Rogers
2025-02-05 18:45           ` Greg Kroah-Hartman
2025-02-04  7:41 ` Alexander Shishkin
2025-02-04 10:16   ` Greg Kroah-Hartman
2025-02-04 14:06     ` Liang, Kan
2025-02-04 15:21       ` Greg Kroah-Hartman
2025-02-04 16:28       ` Greg Kroah-Hartman
2025-02-04 16:41         ` Vince Weaver
2025-02-04 17:12           ` Greg Kroah-Hartman
2025-02-04 17:49             ` Ian Rogers
2025-02-04 18:03               ` Greg Kroah-Hartman [this message]
2025-02-05  1:21                 ` Vince Weaver
2025-02-05  5:45                   ` Greg Kroah-Hartman
2025-02-05 15:06                     ` Vince Weaver
2025-02-05 15:36                       ` Greg Kroah-Hartman
2025-02-04 18:23         ` Liang, Kan
2025-02-05 16:00           ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2025020444-savage-latrine-0c31@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vincent.weaver@maine.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.