[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250620080426.GO1613376@noisy.programming.kicks-ass.net>
Date: Fri, 20 Jun 2025 10:04:26 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>, kernel@...labora.com,
Jonathan Corbet <corbet@....net>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/headers: Document PERF_PMU_CAP capability flags
On Thu, Jun 19, 2025 at 06:06:50PM +0200, Nicolas Frattaroli wrote:
> > > #define PERF_PMU_CAP_NO_INTERRUPT 0x0001
> >
> > This is not quite right; CAP_NO_INTERRUPT means it is not able to
> > generate samples.
> >
> > While not being able to generate interrupts and not being able to
> > generate sample is more or less the same for CPU PMU drivers, this is
> > not true for uncore drivers. Even if an uncore driver has interrupt
> > capacility to help with counter overflow, it cannot generate samples.
>
> I'll send a follow-up v2 to fix this, though just to make sure I
> understand this right, I have some questions for clarification.
>
> Does "uncore" in this context mean PMU drivers for counters that are not
> tied to the CPU instruction flow, but are counting other things like
> interconnect statistics?
Correct.
> Also, am I correct in assuming "sample" in this context means the
> concept represented by struct perf_sample_data, i.e. what appears to be
> a snapshot of current process context, including registers and stack
> information?
Right; perf_event_attr::sample_type, filled out with bits from
perf_event_sample_format.
> Which would then mean going by my understanding of uncore
> that basically every uncore driver should set this capability flag, as
> they're not performance counter registers on a CPU that are intimately
> tied to the ISAs execution state.
Correct again. There is interconnect, memory and even GPU drivers out
there these days.
> To further my understanding: does this mean that
> drivers/devfreq/event/rockchip-dfi.c (used for measuring memory
> bandwidth) should set PERF_PMU_CAP_NO_INTERRUPT, since it's not a CPU
> but a memory controller monitor?
Yup, that would indeed seem to be so.
> In a more general sense, if anyone has any written resources on writing
> PMU drivers, rather than perf from a userspace perspective, I'd be very
> happy to get some pointers in their direction.
I'm afraid not :/ The best we have is the comments in struct pmu.
Powered by blists - more mailing lists