A few days ago I posted about Fedora 38’s frame pointer change. I stated there that perf using only DWARF information produced inaccurate stack traces. But this isn’t true at all. After working on trying to reproduce those results (with the binutils developers who offered to help) I realised that I made a mistake on the DWARF (Fedora 37, pre-frame-pointer change) results, using:
perf record -a -g -- <cmd>
perf record -a -g --call-graph=dwarf -- <cmd>
The difference is the first command still tries to use frame pointers, which entirely explains the inaccurate stack traces. With the correct parameters, perf record does do the right thing, collecting accurate stack traces even on Fedora 37, and the flame graphs generated look fine.
That caused a lot of noise, and it was wrong.
There are some issues around DWARF vs frame pointers, but they’re not about the accuracy of the stack traces, but about the size of the collected data and the speed of processing it. Using DWARF CFI means that much more data has to be collected (typical
perf.data files grow by more than x10 — on my laptop perf.data grows to 8 GB for a single trace).
One response to “Frame pointers – an important update”
Pingback: Frame pointers vs DWARF – my verdict | Richard WM Jones