tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.29k stars 99 forks source link

Make DWARF great again #152

Open sticnarf opened 2 years ago

sticnarf commented 2 years ago

There have been a lot of issues because of unwinding using backtrace-rs (e.g. #36, #75, #76). They will potentially make the program crash or deadlock. And they lead us to providing an alternative but legacy unwinding mechanism, which uses frame pointers. Frame pointers are solid, but it uses an additional register, and we need special building configurations to enable frame pointers.

The root of these dwarf unwinding issues are:

With gimli and framehop, I think it's possible for us to overcome all these problems.

I make a prototype of unwinding with framehop: https://github.com/sticnarf/runwind. Currently, it supports Linux amd64/aarch64 only.