SFrame is the lightweight stack trace format that can overcome some of the performance obstacles for tracing ELF files compared to frame pointers. In addition to the SFrame support coming together in the GNU toolchain, the SFrame support for LLVM/Clang is beginning to reach upstream.
Merged to LLVM Git last week was introducing the SFrame structures and constants. This largely follows the GNU naming used for their Simple Frame stack trace support.
Building off those initial bits is then this pending pull request for introducing the beginnings of an SFrame parser and dumper.
“This PR adds the SFrameParser class and uses it from llvm-readobj to dump the section contents. Currently, it only supports parsing the SFrame section header. Other parts of the section will be added in follow-up patches.
llvm-readobj uses the same sframe flag syntax as GNU readelf, but I have not attempted match the output format of the tool. I’m starting with the “llvm” output format because it’s easier to generate and lets us tweak the format to make it useful for testing the generation code. If needed, support for the GNU format could be added by overriding this functionality in the GNU ELF Dumper.”
It’s still in the early stages but there is active interest in SFrame support within LLVM. Those wishing to track the ongoing upstreaming work around SFrame support for LLVM can see this issue ticket since 2023 after SFrame in LLVM. This LLVM Discourse has also been discussing SFrame support in LLVM since last month, including an out-of-tree branch with a prototype implementation for the Assembly and linking work.
We’ll see if this SFrame support can come together in time for next spring’s LLVM 22 release.