lo2s icon indicating copy to clipboard operation
lo2s copied to clipboard

lbr call-stack support

Open tilsche opened this issue 2 years ago • 2 comments

With perf --call-graph lbr, has more reliable call stack support. And it should be fine on intel these days, apparently available since Haswell. However, it is (still) not supported by AMD processors (tested with Zen2/Rome).

tilsche avatar Dec 12 '22 13:12 tilsche

From what I've read, we would ideally extend our existing --call-graph option so that --call-graph=lbr gives us LBR and --call-graph=fp (mirroring perfs nomenclature) would give us traditional call stack recording.

On supported platforms, LBR would be chosen as default (hopefully easily identifiable by trying to perf_event_open sampling with LBR), as there is no apparent downside to using LBR.

cvonelm avatar Dec 12 '22 19:12 cvonelm

Branch issue-242-lbr-support contains a draft of support for last branch records.

Initial results look promising, with the samples providing perfect backtraces almost all of the time.

However, the distribution of samples appears weird. During a run of lo2s with FIRESTARTER as a payload, almost all samples came from inside of lo2s.

Wrt this weirdness and the undocumented perf behaviour black magic envolved in creating traces with LBRs, we should continue to keep frame pointers as the default sampling option.;

cvonelm avatar May 08 '23 10:05 cvonelm