Skip to content

Instantly share code, notes, and snippets.

@user202729
Last active October 11, 2024 09:24
Show Gist options
  • Save user202729/b6ea134715ddf851efd0047b3197fc33 to your computer and use it in GitHub Desktop.
Save user202729/b6ea134715ddf851efd0047b3197fc33 to your computer and use it in GitHub Desktop.
perf record [unknown] frames

If you see [unknown], the following might be useful assuming you're using --call-stack dwarf:

  • Note that --call-graph dwarf,1024 (where 1024 is the stack size) dumps first 1024 bytes of the stack to the record file, then use DWARF debug information to deduce the frames later.

    This is quite inefficient (because it dumps the whole stack instead of just the addresses for each sample), but more importantly, if the stack is too deep (1024 bytes is insufficient) then the result is [unknown] frames.

    So, either try increasing it to dwarf,65528 (which is the maximum on my machine), or if it still doesn't work, --call-graph lbr or --call-graph fp (the last one may need recompile).

Other things to try:

Questions that needs to be cleaned up:

References:

Notes:

  • https://brendangregg.com/flamegraphs.html --- explains what is a flame chart (similar to flamegraph, but order the blocks by time instead of by size. I think perf doesn't support this...? Not sure if there's a way)

Other unrelated issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment