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

From: Peter Zijlstra
Date: Tue Nov 05 2024 - 07:24:51 EST


On Thu, Oct 31, 2024 at 10:39:44PM +0000, Chun-Tse Shao wrote:
> It gives useful info on knowing which PMUs are reserved by this process.
> Also add extra attributes 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-orig_type: 0
> perf_event-attr.config1: 0
> perf_event-attr.config2: 0
> perf_event-attr.config3: 0
>
> 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: 65536
> perf_event-attr.config1: 0
> perf_event-attr.config2: 0
> perf_event-attr.config3: 0
> ```

First time I hear about fdinfo.. How much of an ABI is this, and why
this random selection of the perf_event_attr structure? What if someone
else wants something and then we change it. Will this then break ABI?