[PATCH] D54217: Add total function byte size and inline function byte size to "llvm-dwarfdump --statistics"

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 11:29:11 PST 2018


clayborg created this revision.
clayborg added reviewers: aprantl, echristo, dblaikie, probinson.
Herald added a subscriber: JDevlieghere.

A nice metric to know is how much code you have in debug info (in bytes) versus the the number of bytes for inlined functions. This patch reports the total number of bytes for concrete functions (size of all DW_TAG_subprogram DIE address ranges), and the total number of bytes for top level inlined functions. This can help users know how much code has been inlined and help users tune for code size.

The formatted JSON output looks like:

  {
    "version":1,
    "file":"/tmp/a.out.dSYM/Contents/Resources/DWARF/a.out",
    "format":"Mach-O 64-bit x86-64",
    "source functions":4,
    "inlined functions":6,
    "unique source variables":8,
    "source variables":10,
    "variables with location":10,
    "call site entries":0,
    "scope bytes total":789,
    "scope bytes covered":789,
  **  "total function size":147,
    "total inlined function size":39
  **}


Repository:
  rL LLVM

https://reviews.llvm.org/D54217

Files:
  tools/llvm-dwarfdump/Statistics.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54217.172990.patch
Type: text/x-patch
Size: 5505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/55eea55e/attachment.bin>


More information about the llvm-commits mailing list