Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFCv1 0/4] Generating a graph of the size installed by each package
@ 2014-06-07 21:46 Thomas Petazzoni
  2014-06-07 21:46 ` [Buildroot] [RFCv1 1/4] toolchain-external: split target installation from staging installation Thomas Petazzoni
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Thomas Petazzoni @ 2014-06-07 21:46 UTC (permalink / raw)
  To: buildroot

Hello,

I gave a training this week, and one of the question I had was how to
analyze the size of the things that are present on the root
filesystem. And I thought that Buildroot was lacking a tool to help
with this. Therefore, the following set of commits implement a script
that generates a pie chart of the size contribution of each package to
the target root filesystem.

To see an example of the generated pie chart, see:

  http://free-electrons.com/~thomas/pub/buildroot/graph-size.pdf

The implementation consists in adding a global instrumentation hook
that registers which files are installed by each package. A limitation
of the current implementation is that when a file is installed by a
package A and then overriden by package B, the mechanism will assume
the file was installed by package A. Suggestions to welcome on how to
solve this in a reasonably simple way.

The size contribution of each package is not computed directly in the
global instrumentation hook, because all the stripping and cleanup
work takes place in target-finalize, after all packages are
installed. Therefore, the hook only registers the path of the files
that are installed.

The 'graph-size' make target then runs a Python scripts, that looks at
all files in $(TARGET_DIR) and is able to find out, thanks to the data
registered by the global instrumentation hook, to which package the
file belongs. Using this, it is quite simple to generate a pie chart.

Comments, ideas, suggestions are welcome.

Thomas

Thomas Petazzoni (4):
  toolchain-external: split target installation from staging
    installation
  pkg-generic: add step_pkg_size global instrumentation hook
  support/scripts: add graph-size script
  Makefile: implement a graph-size target

 Makefile                                           |   6 +
 package/pkg-generic.mk                             |  24 +++
 support/scripts/graph-size                         | 164 +++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk |  36 ++++-
 4 files changed, 223 insertions(+), 7 deletions(-)
 create mode 100755 support/scripts/graph-size

-- 
2.0.0

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-06-24 20:11 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-07 21:46 [Buildroot] [RFCv1 0/4] Generating a graph of the size installed by each package Thomas Petazzoni
2014-06-07 21:46 ` [Buildroot] [RFCv1 1/4] toolchain-external: split target installation from staging installation Thomas Petazzoni
2014-06-09 21:49   ` Yann E. MORIN
2014-06-10  8:04     ` Thomas Petazzoni
2014-06-10 16:49       ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 2/4] pkg-generic: add step_pkg_size global instrumentation hook Thomas Petazzoni
2014-06-08  2:56   ` Baruch Siach
2014-06-08  8:19     ` Thomas Petazzoni
2014-06-09 22:02   ` Yann E. MORIN
2014-06-10 16:42     ` Jérôme Pouiller
     [not found]     ` <3156840.4l9buZIenR@sagittea>
2014-06-10 16:58       ` Yann E. MORIN
2014-06-10 17:37         ` Jérôme Pouiller
2014-06-24 16:36   ` Arnout Vandecappelle
2014-06-24 16:41     ` Thomas Petazzoni
2014-06-24 16:53     ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 3/4] support/scripts: add graph-size script Thomas Petazzoni
2014-06-09 22:06   ` Yann E. MORIN
2014-06-07 21:46 ` [Buildroot] [RFCv1 4/4] Makefile: implement a graph-size target Thomas Petazzoni
2014-06-09 22:28   ` Yann E. MORIN
2014-06-07 21:54 ` [Buildroot] [RFCv1 0/4] Generating a graph of the size installed by each package Will Wagner
2014-06-08  7:42   ` Thomas Petazzoni
2014-06-24 13:05 ` Luca Ceresoli
2014-06-24 16:26   ` Yann E. MORIN
2014-06-24 16:31   ` Arnout Vandecappelle
2014-06-24 16:42     ` Thomas Petazzoni
2014-06-24 19:54     ` Luca Ceresoli
2014-06-24 20:11       ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox