Heads up: official removal of older AMD (pre-Zen1) support from libpmc/hwpmc
Mitchell Horne <[email protected]> Tue, 21 Apr 2026 12:41:06 -0300
| Newsgroups | gmane.os.freebsd.devel.hackers,gmane.os.freebsd.architechture |
|---|---|
| Message-ID | <[email protected]> |
Hello,
As the title suggests, I have proposed a change [1] to officially remove
the older AMD processor event definitions and logic from the library and
module. This means that processors older than the Zen 1 generation
(~2017) will not be supported by these tools.
I say "officially" because the functionality has been silently disabled
for these older processors since 2020 at least [2].
Among the many known issues, bugs, and sharp-edges relating to hwpmc(4)
and its tools, I am not aware of this complaint being raised or reported
anywhere. (Not to say that users haven't experienced this frustrating
silent failure.)
On the other hand, our documentation for the AMD support in these tools,
pmc.amd(3), mentions only the ancient and initial CPUs supported (e.g.
Athlon64). It says nothing of the newer generations which work quite
well (e.g. Zen3). If you try to use any of the event names in that
manual, it will not succeed [3]. This is a big usability problem.
The first step will be to remove the dead code, per above. Next will be
to update the documentation and the module itself to clearly state which
generations are and are not supported.
If you have feedback or objections to this course of action, I will hear
it. But you will need to make a strong case, or specific request.
Many thanks,
Mitchell
[1] https://github.com/freebsd/freebsd-src/pull/2153
[2] https://reviews.freebsd.org/rS363206
[3] For example (on AMD Zen3, Ryzen 9 5900x):
$ sudo pmcstat -s k8-dc-access sleep 5
pmcstat: ERROR: Cannot allocate system-mode pmc with specification
"k8-dc-access": Invalid argument