Re: [PATCH 2/7] perf: Create a symlink for a PMU

From: Andi Kleen
Date: Thu Jun 24 2021 - 13:28:43 EST



But this is NOT how busses work in the driver model.

PCI classes are great, but we do NOT suddenly add a symlink in sysfs if
a driver goes from being handled by "generic_pci_type_foo" to
"vendor_foo". Userspace can handle the change and life goes on.

In perf this is exposed to the user command line, and lots of people configure their own events, so it's very common in scripts. To use the pmu you have to use something like perf stat -a -e uncore_foo/.../. So it's not a single thing that could be patched up.

The perf tools supports PMUs abstractly and doesn't have special handling for every PMU. Also the perf design was always that the kernel should provide these abstractions with the user tool being (mostly) generic and abstract.


So a device name will move from "generic" to "specific", right?

Why does a bus have to do with any of this?

The perf pmus are in /sys/devices, so the symlinks for compatibility have to be created there.


But a driver does not caer. And if perf does not care, who cares?


The users who write scripts that specify the perf events on the perf command line.


-Andi