4 ms·
"It seems like argument is that cross-referencing the debug info is much slower than following frame pointers, so much so that whole-system profiling becomes im
by DannyBee 4y ago
"It seems like argument is that cross-referencing the debug info is much slower than following frame pointers, so much so that whole-system profiling becomes impractical.
"
Think of all of this like eBPF, which can be done fast enough to work fine.
First, the debug_frame sections are small separate, and self-contained. You don't have to fault in the rest of debug info to decode the frame.
Second, I was, at one point heavily involved in such a thing.
Without breaking confidentiality - it can be done.
Also, for the larger ones, you are sampling anyway if you are using production systems the scale of facebook, because it's cheaper to sample a small percent of the time, and you will get the same coverage/results.
So it is not slow all the time, nor slow on all your machines, nor ...
See, e.g., https://research.google/pubs/pub45290/ https://research.google/pubs/pub45290/
This obviously does not help with running perf live, but ....
Third, if you are concerned about speed, this can also be cached quite well. You can go further too - you can JIT the debug_frame section into executable code if you want, or even compile ahead of time.