News: 0001562512

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

SFrame Support Beginning To Materialize For LLVM/Clang

([LLVM] 6 Hours Ago SFrame + LLVM)


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 [1]the SFrame support coming together in the GNU toolchain , the SFrame support for LLVM/Clang is beginning to reach upstream.

[2]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 [3]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 [4]this issue ticket since 2023 after SFrame in LLVM. [5]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 [6]next spring's LLVM 22 release .



[1] https://www.phoronix.com/news/SFrame-Merged-Glibc-2.42

[2] https://github.com/llvm/llvm-project/commit/ee9b84f5bed7027b4a81f68bf853f35d6e749eef

[3] https://github.com/llvm/llvm-project/pull/147294

[4] https://github.com/llvm/llvm-project/issues/64449

[5] https://discourse.llvm.org/t/rfc-adding-sframe-support-to-llvm/86900

[6] https://www.phoronix.com/news/LLVM-22-Starts-Development



phoronix

Seems a computer engineer, a systems analyst, and a programmer were
driving down a mountain when the brakes gave out. They screamed down the
mountain, gaining speed, but finally managed to grind to a halt, more by
luck than anything else, just inches from a thousand foot drop to jagged
rocks. They all got out of the car:
The computer engineer said, "I think I can fix it."
The systems analyst said, "No, no, I think we should take it
into town and have a specialist look at it."
The programmer said, "OK, but first I think we should get back
in and see if it does it again."