[PATCH] D55091: Add --analyze option to llvm-dwarfdump

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 08:49:16 PST 2018


zturner added a comment.

In D55091#1315371 <https://reviews.llvm.org/D55091#1315371>, @clayborg wrote:

> So do we have a consensus where the --analyze option should go? llvm-dwarfdump or llvm-objdump?


Just want to add a note, that we have PDB-specific size statistics as well, and those are currently reported in llvm-pdbutil.  It doesn't make a lot of sense to report those in llvm-objdump, but it's still very similar to what you're doing here.

I think the section information is reasonable to put in llvm-objdump because sections are things that can appear in any object file, but if we're going to start digging into deeper into format-specific stuff it should go into readobj or dwarfdump in my opinion.

The real observation here though is that there's some overlap between the tools.  We encounter this with PDB as well, and in some cases we want to give *multiple* tools a way to output the same things, simply because it's more convenient to the user.  If  a certain piece of output makes sense for some tool, there's no reason not to expose it from that tool, even if some other tool already exposes it.

To this end, some of the PDB dumping code is actually in a separate library, and we link that library from both llvm-readobj and llvm-pdbutil, and we just call the library to do the dump.  So that's another option.

  Type duplication:
  SIZE    % DWARF % FILE  DUPS   DESCRIPTION
  ------- ------- ------- ------ ------------------------------------
   17.03M   5.20%   4.48% 121696 Other duplicated types ( -min-percent=0.01 )
    3.46M   1.06%   0.91%    636 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > @ 
  ... snip

This looks useful.  Personally I'm interested in seeing some statistics about individual tags.  For example, how much space goes to `DW_TAG_pointer_type` records (in total), and how much space is allocated to duplicate records of each type.  Did you have plans for anything like this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55091/new/

https://reviews.llvm.org/D55091





More information about the llvm-commits mailing list