[openssl-dev] [PATCH] Insert CFI directives in x86_64 SHA1 implementation to enable backtracing

Wim Lewis wiml at omnigroup.com
Wed Mar 25 19:19:28 UTC 2015


On Mar 25, 2015, at 11:56 AM, Matt Cross <matt.cross at gmail.com> wrote:
> I am working with something that does a lot of SHA1's.  I am trying to profile my application and generate flame graphs (see http://www.brendangregg.com/flamegraphs.html ), but profiling tools cannot successfully backtrace when the processor is running the optimized SHA1 code on x86_64.  This patch adds CFI directives when compiled with a GNU assembler to enable tools that understand DWARF debugging information to backtrace in this circumstance.


FYI, I submitted a patch a few years ago to do this for many of the x86-32 assembly files. The perlasm preprocessor already tries to track the stack offset, which means that a lot of those .cfi directives can be generated automatically, without requiring the programmer to keep track of them.

The patches are here:
   http://rt.openssl.org/Ticket/Display.html?id=2562

As you point out, this is pretty useful to allow profiling and/or debugging code that spends a lot of its time in OpenSSL.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20150325/9f3cd1d9/attachment.html>


More information about the openssl-dev mailing list