[Buildroot] [PATCH v4 2015.08 2/4] support/scripts: add size-stats script

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Sep 2 21:08:49 UTC 2015


Ryan,

(Yes, I'm replying to a very old e-mail)

On Wed, 27 May 2015 22:18:32 -0500, Ryan Barnett wrote:

> > +def build_package_size(filesdict, builddir):
> > +    pkgsize = collections.defaultdict(int)
> > +
> > +    for root, _, files in os.walk(os.path.join(builddir, "target")):
> > +        for f in files:
> > +            fpath = os.path.join(root, f)
> > +            if os.path.islink(fpath):
> > +                continue
> > +            frelpath = os.path.relpath(fpath, os.path.join(builddir, "target"))
> > +            if not frelpath in filesdict:
> > +                print("WARNING: %s is not part of any package" % frelpath)
> 
> Would it be useful to have an exclusion list since this will always be
> printed out?
> 
> Every time you run 'make clean all size-stats' you will be faced with
> warnings such as this:
> 
> WARNING: THIS_IS_NOT_YOUR_ROOT_FILESYSTEM is not part of any package
> WARNING: etc/ld.so.cache is not part of any package
> WARNING: etc/hostname is not part of any package
> WARNING: etc/os-release is not part of any package
> WARNING: etc/nsswitch.conf is not part of any package
> WARNING: etc/ld.so.conf is not part of any package
> WARNING: etc/network/interfaces is not part of any package
> WARNING: tmp/ldconfig/aux-cache is not part of any package
> WARNING: dev/console is not part of any package
> 
> Initially when I saw this I didn't do something correct, however, I
> quickly released that these are files that are generated by
> buildroot's makefiles (such as THIS_IS_NOT_YOUR_ROOT_FILESYSTEM and
> etc/hostname). Since this files are generated by buildroot and one
> shouldn't be concerned about this files not being a part of any
> package. While typing this, would it make sense to create a package
> called 'buildroot' whose files are defined statically within this
> script?

Since I am not sure how to handle those files yet, I've left this as is
for the moment. In my tests I'm seeing less warnings now:

thomas at skate:~/projets/buildroot (size-stats-v5)$ make size-stats
WARNING: etc/os-release is not part of any package
WARNING: etc/ld.so.conf is not part of any package
WARNING: etc/hostname is not part of any package
WARNING: etc/network/interfaces is not part of any package

Which looks a bit more reasonable.


> > +    # Reduce text size
> > +    proptease = fm.FontProperties()
> > +    proptease.set_size('xx-small')
> > +    plt.setp(autotexts, fontproperties=proptease)
> > +    plt.setp(texts, fontproperties=proptease)
> 
> Could the total size of filesystem be placed on this graph? I was
> thinking maybe at the bottom of the graph in as a subtitle - don't
> know if this possible?

I've implemented this idea, thanks for the suggestion!

> Another idea would be the option to specify a chart title. This could
> be something that could be used with dependency graph as well or any
> other graph generated by buildroot (can't think of any others off at
> this moment). However, I would say that should be a future feature
> that is implemented.

For this one, I'd say we should handle it together with the other
graphs generated by Buildroot, so I've left it on the side for now.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list