I need to enable frame pointers for --release build, but so far only debug mode works fine.
I know of some merges in rustc enabling frame pointers by default but I don't know the current status.
Does it even suppose to work? Did I hit a bug or something?
Cause if -Cforce-frame-pointers flag works only for debug builds its kinda useless.
And I need to enable frame pointers anyway.
At least a simple example like fn main() { loop { foo() } } #[inline(never)] fn foo() { print!(""); } when compiled with rustc - -Copt-level=3 -Cforce-frame-pointers correctly handles backtraces in perf with --call-graph=fp for me. Did you perhaps enable stripping in release mode?
the sequence a -> b -> c is missing on the 2nd picture!
I learned about missing fp in compiled languages problem from BPF Performance Tools book.
If its not frame pointers, then what?
Does it have something to do with strange function names?
Assuming that a, b and c do nothing other than call another function, this is likely caused by tail call optimization. Basically whenever possible LLVM will replace the last call in a function body with a direct jump to the callee. This means that the stack frame for the function is gone unrecoverably and neither profilers nor debuggers can figure out that the stack frame should have existed. Even when compiling with frame pointers and full debuginfo.