Finding a profiler that works, damnit
Posted Mar 24, 2010 1:55 UTC (Wed) by foom
In reply to: Finding a profiler that works, damnit
Parent article: KVM, QEMU, and kernel project management
>Sure, how could it be another way? Without frame pointers you can't have reliable
stacktraces. Or if you have a tip to go round this requirement I would be happy to implement it.
The only arch I know that is able to walk the stack correctly without frame pointers is PowerPc.
GCC always includes an eh_frame section (unless you explicitly pass -
fnoasynchronous-unwind-tables, which of
should never do), which allows you to unwind reliably from any point within a program. This is
actually required by the X86-64
This data is never stripped, and actually is mapped into memory with the code and data of the
executable, so you can read it directly from the process's memory space. It's almost the
same format data as the DWARF debug info, but with a couple minor differences and with only a
subset of the functionality allowed.
See libunwind for a userspace library which
knows how to read and interpret this data. Google-perftools uses libunwind, which is how it's
able to work properly.
to post comments)