Re: [PATCH v8 1/2] perf: Reveal PMU type in fdinfo

From: Peter Zijlstra

Date: Thu Jun 04 2026 - 05:27:36 EST


On Tue, Jun 02, 2026 at 11:13:48AM -0700, Chun-Tse Shao wrote:
> It gives useful info on knowing which PMUs are reserved by this process.
> Also add config which would be useful.
> Testing cycles:
>
> $ ./perf stat -e cycles &
> $ cat /proc/`pidof perf`/fdinfo/3
> pos: 0
> flags: 02000002
> mnt_id: 16
> ino: 3081
> perf_event_attr.type: 0
> perf_event_attr.config: 0x0
> perf_event_attr.config1: 0x0
> perf_event_attr.config2: 0x0
> perf_event_attr.config3: 0x0
> perf_event_attr.config4: 0x0
>
> Testing L1-dcache-load-misses:
>
> $ ./perf stat -e L1-dcache-load-misses &
> $ cat /proc/`pidof perf`/fdinfo/3
> pos: 0
> flags: 02000002
> mnt_id: 16
> ino: 1072
> perf_event_attr.type: 3
> perf_event_attr.config: 0x10000
> perf_event_attr.config1: 0x0
> perf_event_attr.config2: 0x0
> perf_event_attr.config3: 0x0
> perf_event_attr.config4: 0x0
>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
> Signed-off-by: Chun-Tse Shao <ctshao@xxxxxxxxxx>
> Assisted-by: Gemini:gemini-3.1-pro-preview
> ---

Yeah, I suppose I'll take this. But I'm not sure about the wording here.
PMUs aren't really reserved as such.