bloat-blame [options] binary
bloat-blame
is a tool for working out how many bytes each line of source code
takes up in a C++ program. It uses addr2line
and readelf
to parse debug
info.
--extent [all|.text]
: Specifies which bytes within the binary should be analysed
bloat-blame
depends on:
- Python
- addr2line - a part of GNU binutils
- objdump - also a part of GNU binutils
-
Build your program/library with debug info turned on:
$ CFLAGS='-g' make
-
Run bloat-blame on the resulting binary:
$ bloat-blame ./myprog
bloat-blame
will output something like:
22 src/main.c:22
213 src/main.c:23
7653 src/bloat.c:324
This is a list in ascending order of size. The first column is the number of bytes apportioned to the file/line in the second column.
bloat-blame
is Copyright (C) 2012 YouView TV Ltd. and is distributed under
the GNU General Public License version 2 or at your option any later version.
See the COPYING file for more information. This licence was chosen to be
consistent with GNU binutils.