Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
AMD Branch Sampling Support Being Worked On For Linux
AMD Family 19h "Zen 3" processors support this branch sampling feature for collecting details on branches taken during code execution. The latest AMD Zen 3 processors do contain improvements to BRS functionality. AMD BRS is detailed within their processor programming reference guides that are public but until now with this new patch series sent out by a Google engineer there hasn't been any Linux support/integration.
This AMD BRS bring-up for Linux is integrating the functionality into Linux's wonderful perf subsystem. But long story short why this AMD Branch Sampling support is news worthy is that the functionality can be used for AutoFDO-style optimizations on AMD processors with the compiler leveraging that collected hardware data to make more informed and accurate optimization decisions. With Google engineers working on this BRS bring-up, that appears to be their motivation is to in turn leverage it for compiler optimizations.
AMD's exposed feature set for "perf" on Linux has traditionally been lacking compared to Intel and the exposed performance counters, but it's great that in recent times there has been catching up. Once this AMD BRS support is squared away, it will be fun to see what compiler optimization work will come in leveraging this sampling data.
The set of 13 patches getting Linux's perf code wired up for AMD Zen BRS support can be found on the kernel mailing list.