AMD "Smart Trace Buffer" Feature Being Wired Up For Linux
Earlier this month the initial patch was posted for enabling AMD Smart Trace Buffer support on Linux as an extension to AMD's PMC kernel driver. This morning the STB enablement has already been revised in a second version of the patches.
AMD Smart Trace Buffer is described by the patches as "a debug trace buffer which is used to help isolate failures by analyzing the last feature that a system was running before hitting a failure. This nonintrusive way is always running in the background and trace is stored into the SoC."
It's basically a means of helping to isolate where a system problem may have occurred. Adding the Smart Trace Buffer support to the AMD PMC driver is little more than one hundred lines of code. The Smart Trace Buffer contents can then be read on the system via DebugFS with a new file named stb_read. Enabling it can be done via the amd_pmc.enable_stb=1 module parameter with it at least for now not being enabled by default from the driver reporting side.
Intel's Trace Hub is somewhat along similar lines but appearing to be much more feature-rich than AMD Smart Trace Buffer with a broader scope in offering many more features around system debug. Intel Trace Hub has also been supported under Linux for a while via the intel_th driver.
The v2 patch was posted this morning on the kernel mailing list. Besides the discussion around this patch work, I haven't been able to find any other substantive public information on AMD Smart Trace Buffer. But there was a reference to Smart Trace Buffer from some Cezanne PSP firmware hits, so it's at least been present in AMD SoCs already. From the patch discussion around AMD STB there was also some excitement that this functionality may also help the AMD engineers in debugging some of the outstanding suspend-to-idle issues plaguing some AMD Linux systems.