AMD Branch Sampling Support Being Worked On For Linux

Written by Michael Larabel in AMD on 9 September 2021 at 06:00 AM EDT. 3 Comments
A new kernel patch series was posted this morning working on AMD Branch Sampling "BRS" support.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week