Giter VIP home page Giter VIP logo

bloat's Introduction

bloat

Generate webtreemap-compatible JSON summaries of binary size.

Setup

  1. Check out a copy of webtreemap in a webtreemap subdirectory:

     git clone git://github.com/martine/webtreemap.git
    
  2. Build your binary with the -g flag to get symbols.

  3. Run ./bloat.py --help and generate nm.out as instructed there.

  4. Example command line:

     ./bloat.py --strip-prefix=/path/to/src syms > bloat.json
    

Misc other feature

Dump large symbols:

$ ./bloat.py dump | head -20

bloat's People

Contributors

avar avatar evmar avatar jfbastien avatar maxinbjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloat's Issues

Error while parsing demangled io streams ops

Hello!

bloat.py syms fails:

Traceback (most recent call last):
File "./bloat.py", line 408, in
dump_nm(nmfile, strip_prefix=opts.strip_prefix, cppfilt=opts.cppfilt)
File "./bloat.py", line 303, in dump_nm
dirs = treeify_syms(parse_nm(nmfile), strip_prefix, cppfilt)
File "./bloat.py", line 216, in treeify_syms
parts = parse_cpp_name(sym, cppfilt)
File "./bloat.py", line 199, in parse_cpp_name
(part, name) = parse_one(name)
File "./bloat.py", line 183, in parse_one
if val[gt] == '<':
IndexError: string index out of range

on line QDataStream& operator<< <QWidgetItemData>(QDataStream&, QVector<QWidgetItemData> const&)

bloat.py syms doesn't deal well with duplicated symbols in anonymous namespaces

I ran into this error today:

Traceback (most recent call last):
  File "./bloat.py", line 408, in <module>
    dump_nm(nmfile, strip_prefix=opts.strip_prefix, cppfilt=opts.cppfilt)
  File "./bloat.py", line 305, in dump_nm
    json.dumps(jsonify_tree(dirs, '[everything]'), indent=2))
  File "./bloat.py", line 270, in jsonify_tree
    subtree = jsonify_tree(val, key)
  File "./bloat.py", line 276, in jsonify_tree
    assert len(symbols) == 1, symbols.values()[0] == 1
AssertionError: True

As best I can tell, this is caused by having the following in nm.out:

0000000003de3c00 0000000000000080 d (anonymous namespace)::gHistograms
...
00000000031cf640 000000000000bf20 r (anonymous namespace)::gHistograms

which is legal C++, but problematic for any scheme that assumes that the name equivalency of symbols implies equivalency of the symbols themselves.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.