Page MenuHomeFreeBSD

libpmc: Add support for recent AMD chips
AbandonedPublic

Authored by ali_mashtizadeh.com on Jun 5 2020, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 5:09 AM
Unknown Object (File)
Mar 7 2024, 1:59 AM
Unknown Object (File)
Mar 7 2024, 1:58 AM
Unknown Object (File)
Mar 7 2024, 12:55 AM
Unknown Object (File)
Mar 7 2024, 12:00 AM
Unknown Object (File)
Dec 22 2023, 11:12 PM
Unknown Object (File)
Dec 13 2023, 12:10 AM
Unknown Object (File)
Nov 12 2023, 11:16 AM

Details

Reviewers
mmacy
Summary

Add support for recent AMD chips including Threadripper Zen+/Zen2 and Ryzen Zen 2
As a bonus I fixed an error message.

Test Plan

Running pmccontrol and pmcstat

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31529
Build 29133: arc lint + arc unit

Event Timeline

ali_mashtizadeh.com created this revision.
ali_mashtizadeh.com retitled this revision from Add support for recent AMD chips including Threadripper Zen+/Zen2 and Ryzen Zen 2 As a bonus I fixed an error message. to libpmc: Add support for recent AMD chips.Jun 5 2020, 5:11 PM
ali_mashtizadeh.com edited the summary of this revision. (Show Details)

Could you clarify if these files are synced from Linux or generated from the manuals? I wanted to add a few counters that appear in the documentation but are missing from both the Intel and FreeBSD definitions. What would be the best way should we add definitions to the existing files in the correct place or create a new file to track these additions?

If you add a new file it won’t be overwritten by updates

Most of it is in Linux's amdzen2 files should I just merge those under a new name? Seems weird they didn't use versioning. Do you have a better plan how to deal with these? (Also is the Linux tree the correct source for these json files?)

  • Adding missing counters for Zen+ and Zen2

Some counters from the Linux repo appear to be undocumented at the moment and I left those out. Also they seem to think some of these are available on earlier platforms but I don't see that in the documentation nor can I test it.

I'm a bit confused. The counter descriptions are just copied from Linux. If you're just copying from there, just add them as is. If you're doing something new then add them as a different file.

I'm a bit confused. The counter descriptions are just copied from Linux. If you're just copying from there, just add them as is. If you're doing something new then add them as a different file.

Sorry Matthew, if you clarify what you would like to see I'm happy to prepare the diff. Here's three options.

  1. [Current] I wrote the definitions from AMD PPR 55803 which is the only document I can find for Zen2. I'm assuming the Linux version is based on that so it's similar, but they had a few counters I could not find a reference for.

https://developer.amd.com/wp-content/resources/55803_0.54-PUB.pdf

  1. Merge the definitions into the correct files in the existing amdfam17h folder. i.e. the core counters will be placed in core.json.
  1. Create a new folder for the AMD Zen2 definition (called amdzen2) and I'll merge FreeBSD's additional l3cache definitions that don't appear in Linux's repository.

It may be worth while keeping Zen1 & 2 as a single folder, as the Linux repository suggests some Zen2 counters work in prior models.