You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/DebugInfo.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -991,6 +991,15 @@ When `callgrind` is used in combination with a viewer like
991
991
information about native image execution aand relate it back to
992
992
specific source code lines.
993
993
994
-
### Related Documentation
994
+
### Call-graph recording with `perf record`
995
+
996
+
Normally when perf does stack frame recording (i.e. when `--call-graph` is used), it uses frame pointers to recognize the individual stack frames.
997
+
This assumes that the executable that gets profiled actually preserves frame pointers whenever a function gets called.
998
+
For native-images this can be achieved by using `-H:+PreserveFramePointer` as an image build argument.
999
+
1000
+
An alternative solution is to make perf use dwarf debug info (specifically debug_frame data) to help unwinding stack frames.
1001
+
To make this work, the image needs to be built with `-g` (to generate debuginfo) and `perf record` needs to use argument `--call-graph dwarf` to make sure dwarf debug info (instead of frame pointers) is used for stack unwinding.
1002
+
1003
+
## Related Documentation
995
1004
996
1005
-[Debug Native Executables with GDB](guides/debug-native-executables-with-gdb.md)
0 commit comments