Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 6
    By default perf record uses the frame pointer register. Modern compilers don't record the frame address and instead use the register as a general purpose. The alternative is to compile with -fno-omit-frame-pointer flag or use a different alternative: record with --call-graph "dwarf" or --call-graph "lbr" depending on your scenario. Commented Mar 30, 2020 at 15:27
  • 2
    KDAB's hotspot ships with an AppImage these days, making it really easy to use. Commented Jun 28, 2022 at 16:23
  • Great answer. Side note, [unknown] frames might be caused by stack too deep if DWARF method is used --- although I haven't investigated very carefully. gist.github.com/user202729/b6ea134715ddf851efd0047b3197fc33 has some resources. Commented Feb 2, 2024 at 13:58
  • Great answer. But seems like gprof can't profile shared libraries. Commented Feb 28, 2024 at 23:33
  • For gprof I found that gprof main.out > main.gprof gives the error gmon.out: "not in executable format", and the program was required as an input for the call, i.e. gprof ./myprog main.out > main.gprof Commented Oct 1, 2024 at 8:30