All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-19  2:28   ` Ricardo Martincoski
  2019-08-26 20:53   ` Arnout Vandecappelle
  2019-08-17 17:18 ` [Buildroot] [PATCH 2/9] support/graph-size: introduce main() Yann E. MORIN
                   ` (8 subsequent siblings)
  9 siblings, 2 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

There are three E501 warnings returned by flake8, when run locally,
because we enforce a local 80-char limit, but that are not reported by
the gitlab-ci jobs because only a 132-char limit is required there.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

---
I initially whined loudly when this discrepancy was added, but now I
can prove that it is bad: running flake8 on a locally-modified script
will return errors that have not been introduced by the developer, but
by a previous change by someone else that was not careful to run flake8
on it... Sigh... :-(
---
 support/scripts/size-stats | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index deea92e278..8dfa391e24 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -66,8 +66,8 @@ def add_file(filesdict, relpath, abspath, pkg):
 #
 def build_package_dict(builddir):
     filesdict = {}
-    with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
-        for l in filelistf.readlines():
+    with open(os.path.join(builddir, "build", "packages-file-list.txt")) as f:
+        for l in f.readlines():
             pkg, fpath = l.split(",", 1)
             # remove the initial './' in each file path
             fpath = fpath.strip()[2:]
@@ -151,7 +151,8 @@ def draw_graph(pkgsize, outputf):
     plt.setp(texts, fontproperties=proptease)
 
     plt.suptitle("Filesystem size per package", fontsize=18, y=.97)
-    plt.title("Total filesystem size: %d kB" % (total / 1000.), fontsize=10, y=.96)
+    plt.title("Total filesystem size: %d kB" % (total / 1000.), fontsize=10,
+              y=.96)
     plt.savefig(outputf)
 
 
@@ -209,7 +210,8 @@ def gen_packages_csv(pkgsizes, outputf):
     total = sum(pkgsizes.values())
     with open(outputf, 'w') as csvfile:
         wr = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_MINIMAL)
-        wr.writerow(["Package name", "Package size", "Package size in system (%)"])
+        wr.writerow(["Package name", "Package size",
+                     "Package size in system (%)"])
         for (pkg, size) in pkgsizes.items():
             wr.writerow([pkg, size, "%.1f" % (float(size) / total * 100)])
 
-- 
2.20.1

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

* [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size)
@ 2019-08-17 17:18 Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Hello All!

This series brings in a few improvements to the graph-size feature:

  - add option to inverse the ordering
  - add option to use IEC or SI prefixes (binary / decimal)
  - add option to change the cut-off grouping limit
  - shuffle the colours to better represent bigger packages
  - hide Others and Unknown if empty
  - some flake8 fixes and other cleanups

See below for an example graph that we can now get:

begin-base64 664 graph-size.pdf.xz
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4E3ANZ5dABKUBIRwraTHJ3BmPNKg
V+2lUJTx+Ev4pbqBh2FCh/Brz+z/iiH6UtgOQPg1kI/VqTgKtjDgFPoKNin8
BliKojvBDfpQi0b5eeWwtja6v5LvWaYRFfNama30gttYrkhT72eHLWDp0h4x
6KI6cCd4jpZeUor7+4eGMjAepessDTLT05MvN4BnZUowMAcBSng1rARXWIaa
ktDeAJQbFHtmO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O5P
eUcr6tWE/DstOAMq3HasTza+pztO77o9QGpR2NizaTYoEha/IVunz2LsKaSq
uoLx4GVbZWAvLoUU71sektXb34C3KvAeDrZmaIgKNdAAAAA9u+UFEhKuUwAB
umvBmwEAoU1KsLHEZ/sCAAAAAARZWg==
====


Regards,
Yann E. MORIN.


The following changes since commit dac7df1775c97c68b4eda9468a972005d2e6f3f1

  package/qt5multimedia: fix build without opengl (2019-08-17 16:26:07 +0200)


are available in the git repository at:

  git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to a909934ace732d61aac79aa4fdc6d3f0176c17bc

  support/graph-size: reorder colours assigned to sizes (2019-08-17 18:22:59 +0200)


----------------------------------------------------------------
Yann E. MORIN (9):
      support/graph-size: fix flake8 warnings
      support/graph-size: introduce main()
      support/graph-size: don't report "Others" if size is zero
      support/graph-size: report 'Unkown" after all packages, but before "Others"
      support/graph-size: display human-readable size
      support/graph-size: add option to change percentage to group in Others
      support/graph-size: add option to report size with IEC prefixes
      support/graph-size: add option to sort packages in reverse size order
      support/graph-size: reorder colours assigned to sizes

 Makefile                     |   3 +-
 docs/manual/common-usage.txt |  18 ++++++
 support/scripts/size-stats   | 140 ++++++++++++++++++++++++++++++++-----------
 3 files changed, 124 insertions(+), 37 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/9] support/graph-size: introduce main()
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 3/9] support/graph-size: don't report "Others" if size is zero Yann E. MORIN
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

It is nicer overall to have a main() function, like all our other
scripts tend to have too.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/size-stats | 45 +++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 8dfa391e24..bd10fbfb68 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -216,27 +216,32 @@ def gen_packages_csv(pkgsizes, outputf):
             wr.writerow([pkg, size, "%.1f" % (float(size) / total * 100)])
 
 
-parser = argparse.ArgumentParser(description='Draw size statistics graphs')
+def main():
+    parser = argparse.ArgumentParser(description='Draw size statistics graphs')
 
-parser.add_argument("--builddir", '-i', metavar="BUILDDIR", required=True,
-                    help="Buildroot output directory")
-parser.add_argument("--graph", '-g', metavar="GRAPH",
-                    help="Graph output file (.pdf or .png extension)")
-parser.add_argument("--file-size-csv", '-f', metavar="FILE_SIZE_CSV",
-                    help="CSV output file with file size statistics")
-parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
-                    help="CSV output file with package size statistics")
-args = parser.parse_args()
+    parser.add_argument("--builddir", '-i', metavar="BUILDDIR", required=True,
+                        help="Buildroot output directory")
+    parser.add_argument("--graph", '-g', metavar="GRAPH",
+                        help="Graph output file (.pdf or .png extension)")
+    parser.add_argument("--file-size-csv", '-f', metavar="FILE_SIZE_CSV",
+                        help="CSV output file with file size statistics")
+    parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
+                        help="CSV output file with package size statistics")
+    args = parser.parse_args()
 
-# Find out which package installed what files
-pkgdict = build_package_dict(args.builddir)
+    # Find out which package installed what files
+    pkgdict = build_package_dict(args.builddir)
 
-# Collect the size installed by each package
-pkgsize = build_package_size(pkgdict, args.builddir)
+    # Collect the size installed by each package
+    pkgsize = build_package_size(pkgdict, args.builddir)
 
-if args.graph:
-    draw_graph(pkgsize, args.graph)
-if args.file_size_csv:
-    gen_files_csv(pkgdict, pkgsize, args.file_size_csv)
-if args.package_size_csv:
-    gen_packages_csv(pkgsize, args.package_size_csv)
+    if args.graph:
+        draw_graph(pkgsize, args.graph)
+    if args.file_size_csv:
+        gen_files_csv(pkgdict, pkgsize, args.file_size_csv)
+    if args.package_size_csv:
+        gen_packages_csv(pkgsize, args.package_size_csv)
+
+
+if __name__ == "__main__":
+    main()
-- 
2.20.1

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

* [Buildroot] [PATCH 3/9] support/graph-size: don't report "Others" if size is zero
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 2/9] support/graph-size: introduce main() Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others" Yann E. MORIN
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/size-stats | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index bd10fbfb68..398c256e8b 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -137,8 +137,9 @@ def draw_graph(pkgsize, outputf):
         else:
             labels.append("%s (%d kB)" % (p, sz / 1000.))
             values.append(sz)
-    labels.append("Other (%d kB)" % (other_value / 1000.))
-    values.append(other_value)
+    if other_value != 0:
+        labels.append("Other (%d kB)" % (other_value / 1000.))
+        values.append(other_value)
 
     plt.figure()
     patches, texts, autotexts = plt.pie(values, labels=labels,
-- 
2.20.1

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

* [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others"
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 3/9] support/graph-size: don't report "Others" if size is zero Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-26 20:53   ` Arnout Vandecappelle
  2019-08-17 17:18 ` [Buildroot] [PATCH 5/9] support/graph-size: display human-readable size Yann E. MORIN
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Currently, the "unknown" category may be reproted anywhere, so it does
not really stand out when there are a lot of packages in the graph.

Move it towards the end, but right before the "other" category, so that
it is a bit more visible. Like for Others, don;t report it if its size
is zero.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/size-stats | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 398c256e8b..82258e4606 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -131,12 +131,18 @@ def draw_graph(pkgsize, outputf):
     labels = []
     values = []
     other_value = 0
+    unknown_value = 0
     for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
         if sz < (total * 0.01):
             other_value += sz
+        elif p == "unknown":
+            unknown_value = sz
         else:
             labels.append("%s (%d kB)" % (p, sz / 1000.))
             values.append(sz)
+    if unknown_value != 0:
+        labels.append("Unknown (%d kB)" % (unknown_value / 1000.))
+        values.append(unknown_value)
     if other_value != 0:
         labels.append("Other (%d kB)" % (other_value / 1000.))
         values.append(other_value)
-- 
2.20.1

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

* [Buildroot] [PATCH 5/9] support/graph-size: display human-readable size
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others" Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others Yann E. MORIN
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Currently, we forcibly report sizes in multiple of Kilobytes. In some
big configurations, the sizes of the system as a whole, as well as that
of individual packages, may exceed megabytes, and when some artistic
assets get used, even the giagbyte may get exceed.

These big sizes are not easy to read when expressed in kilobytes.

Additionally, some very small packages might have sizes below the
kilobyte (and now we can specify the cut-off grouping size, they may
get reported), and thus the size displayed for those would be 0 kB.

Add a help function that can format a floating-point size into a string
with all the appropriate formatting:

  - there are at least 3 meaningfull digits visible, i.e. we display
    "3.14" or "10.4" instead of just "3" or "10", but for big number we
    don't care about too many precision either, so we report "100" or
    "1000", not "100.42" or "1000.27";

  - the proper SI prefix is appended, if needed.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/size-stats | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 82258e4606..eb09e0dc60 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -22,6 +22,7 @@ import os.path
 import argparse
 import csv
 import collections
+import math
 
 try:
     import matplotlib
@@ -127,6 +128,17 @@ def build_package_size(filesdict, builddir):
 # outputf: output file for the graph
 #
 def draw_graph(pkgsize, outputf):
+    def size2string(sz):
+        divider = 1000.0
+        prefixes = ['', 'k', 'M', 'G', 'T']
+        while sz > divider and len(prefixes) > 1:
+            prefixes = prefixes[1:]
+            sz = sz/divider
+        # precision is made so that there are always at least three meaningful
+        # digits displayed (e.g. '3.14' and '10.4', not just '3' and '10')
+        precision = int(2-math.floor(math.log10(sz))) if sz < 1000 else 0
+        return '{:.{prec}f} {}B'.format(sz, prefixes[0], prec=precision)
+
     total = sum(pkgsize.values())
     labels = []
     values = []
@@ -138,13 +150,13 @@ def draw_graph(pkgsize, outputf):
         elif p == "unknown":
             unknown_value = sz
         else:
-            labels.append("%s (%d kB)" % (p, sz / 1000.))
+            labels.append("%s (%s)" % (p, size2string(sz)))
             values.append(sz)
     if unknown_value != 0:
-        labels.append("Unknown (%d kB)" % (unknown_value / 1000.))
+        labels.append("Unknown (%s)" % (size2string(unknown_value)))
         values.append(unknown_value)
     if other_value != 0:
-        labels.append("Other (%d kB)" % (other_value / 1000.))
+        labels.append("Other (%s)" % (size2string(other_value)))
         values.append(other_value)
 
     plt.figure()
@@ -158,7 +170,7 @@ def draw_graph(pkgsize, outputf):
     plt.setp(texts, fontproperties=proptease)
 
     plt.suptitle("Filesystem size per package", fontsize=18, y=.97)
-    plt.title("Total filesystem size: %d kB" % (total / 1000.), fontsize=10,
+    plt.title("Total filesystem size: %s" % (size2string(total)), fontsize=10,
               y=.96)
     plt.savefig(outputf)
 
-- 
2.20.1

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

* [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (4 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 5/9] support/graph-size: display human-readable size Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-26 20:53   ` Arnout Vandecappelle
  2019-08-17 17:18 ` [Buildroot] [PATCH 7/9] support/graph-size: add option to report size with IEC prefixes Yann E. MORIN
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Currently, we group packages that contribute less then 1%, into the
"Other" category.

However, in some cases, there can be a lot of very comparatively small
packages, and they may not exceed this limit, and so only the "Others"
category would be displayed, which is not nice.

Conversely, if there are a lot of packages, most of which only so
slightly exceeding this limit, then we get all of them in the graph,
which is not nice either.

Add a way for the developers to pass a different cut-off limit. As for
the dependency graph which has BR2_GRAPH_DEPS_OPTS, add the environment
variable BR2_GRAPH_SIZE_OPTS to carry those extra option (in preparation
for more to come, later).

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 Makefile                     |  3 ++-
 docs/manual/common-usage.txt | 12 ++++++++++++
 support/scripts/size-stats   | 19 +++++++++++++++----
 3 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 406efd1ab6..e4aa074e4a 100644
--- a/Makefile
+++ b/Makefile
@@ -892,7 +892,8 @@ graph-size:
 	$(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
 		--graph $(GRAPHS_DIR)/graph-size.$(BR_GRAPH_OUT) \
 		--file-size-csv $(GRAPHS_DIR)/file-size-stats.csv \
-		--package-size-csv $(GRAPHS_DIR)/package-size-stats.csv
+		--package-size-csv $(GRAPHS_DIR)/package-size-stats.csv \
+		$(BR2_GRAPH_SIZE_OPTS)
 
 .PHONY: check-dependencies
 check-dependencies:
diff --git a/docs/manual/common-usage.txt b/docs/manual/common-usage.txt
index a36301afd5..7e78d350d4 100644
--- a/docs/manual/common-usage.txt
+++ b/docs/manual/common-usage.txt
@@ -102,6 +102,8 @@ to +make+ or set in the environment:
   xref:graph-depends[] for the accepted options
 * +BR2_GRAPH_DOT_OPTS+ is passed verbatim as options to the +dot+ utility to
   draw the dependency graph.
+* +BR2_GRAPH_SIZE_OPTS+ to pass extra options to the size graph; see
+  xref:graph-size[] for the acepted options
 
 An example that uses config files located in the toplevel directory and
 in your $HOME:
@@ -278,6 +280,7 @@ only other format supported is PNG:
 BR2_GRAPH_OUT=png make graph-build
 ----------------
 
+[[graph-size]]
 === Graphing the filesystem size contribution of packages
 
 When your target system grows, it is sometimes useful to understand
@@ -314,6 +317,15 @@ Just like for the duration graph, a +BR2_GRAPH_OUT+ environment variable
 is supported to adjust the output file format. See xref:graph-depends[]
 for details about this environment variable.
 
+Additionally, one may set the environment variable +BR2_GRAPH_SIZE_OPTS+
+to further control the generated graph. Accepted options are:
+
+* `--size-limit X`, `-l X`, will group all packages which individual
+  contribution is below `X` percent, to a single entry labelled _Others_
+  in the graph. By default, `X=0.01`, which means packages each
+  contributing less than 1% are grouped under _Others_. Accepted values
+  are in the range `[0.0..1.0]`.
+
 .Note
 The collected filesystem size data is only meaningful after a complete
 clean rebuild. Be sure to run +make clean all+ before using +make
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index eb09e0dc60..3454acd681 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -33,8 +33,11 @@ except ImportError:
     sys.stderr.write("You need python-matplotlib to generate the size graph\n")
     exit(1)
 
-colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
-          '#0068b5', '#f28e00', '#940084', '#97c000']
+
+class Config():
+    size_limit = 0.01
+    colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
+              '#0068b5', '#f28e00', '#940084', '#97c000']
 
 
 #
@@ -145,7 +148,7 @@ def draw_graph(pkgsize, outputf):
     other_value = 0
     unknown_value = 0
     for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
-        if sz < (total * 0.01):
+        if sz < (total * Config.size_limit):
             other_value += sz
         elif p == "unknown":
             unknown_value = sz
@@ -162,7 +165,7 @@ def draw_graph(pkgsize, outputf):
     plt.figure()
     patches, texts, autotexts = plt.pie(values, labels=labels,
                                         autopct='%1.1f%%', shadow=True,
-                                        colors=colors)
+                                        colors=Config.colors)
     # Reduce text size
     proptease = fm.FontProperties()
     proptease.set_size('xx-small')
@@ -246,8 +249,16 @@ def main():
                         help="CSV output file with file size statistics")
     parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
                         help="CSV output file with package size statistics")
+    parser.add_argument("--size-limit", "-l", type=float,
+                        help='Under this size ratio, files are accounted to ' +
+                             'the generic "Other" package. Default: 0.01 (1%%)')
     args = parser.parse_args()
 
+    if args.size_limit is not None:
+        if args.size_limit < 0.0 or args.size_limit > 1.0:
+            raise ValueError("--size-limit must be in [0.0..1.0]")
+        Config.size_limit = args.size_limit
+
     # Find out which package installed what files
     pkgdict = build_package_dict(args.builddir)
 
-- 
2.20.1

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

* [Buildroot] [PATCH 7/9] support/graph-size: add option to report size with IEC prefixes
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (5 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 8/9] support/graph-size: add option to sort packages in reverse size order Yann E. MORIN
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

When dealing with embedded devices, storage is more often than not some
kind of flash device, on which the memory is usually counted as powers
of 1024 instead of powers of 1000. As such, people may prefer reports
using IEC prefixes [0] instead of the SI prefixes.

Add an option to that effect.

We use argparse's ability to use custom actions [1] [2], to provide a
set of options that act on a boolean, but has a single help entry and
internally ensures consistency of the settings. We could have been using
the more conventional store_true/stor_false actions instead, but that
would have meant either two help entries, one for each set of options,
and/or some logic after parse_args() to check the validity of the
settings.

[0] https://en.wikipedia.org/wiki/Binary_prefix
[1] https://docs.python.org/2/library/argparse.html#action
[2] https://docs.python.org/2/library/argparse.html#argparse.Action

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 docs/manual/common-usage.txt |  3 +++
 support/scripts/size-stats   | 29 +++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/docs/manual/common-usage.txt b/docs/manual/common-usage.txt
index 7e78d350d4..5653e85e12 100644
--- a/docs/manual/common-usage.txt
+++ b/docs/manual/common-usage.txt
@@ -326,6 +326,9 @@ to further control the generated graph. Accepted options are:
   contributing less than 1% are grouped under _Others_. Accepted values
   are in the range `[0.0..1.0]`.
 
+* `--iec`, `--binary`, `--si`, `--decimal`, to use IEC (binary, powers
+  of 1024) or SI (decimal, powers of 1000; the default) prefixes.
+
 .Note
 The collected filesystem size data is only meaningful after a complete
 clean rebuild. Be sure to run +make clean all+ before using +make
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 3454acd681..5bf0ee6e95 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -35,6 +35,7 @@ except ImportError:
 
 
 class Config():
+    iec = False
     size_limit = 0.01
     colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
               '#0068b5', '#f28e00', '#940084', '#97c000']
@@ -132,8 +133,12 @@ def build_package_size(filesdict, builddir):
 #
 def draw_graph(pkgsize, outputf):
     def size2string(sz):
-        divider = 1000.0
-        prefixes = ['', 'k', 'M', 'G', 'T']
+        if Config.iec:
+            divider = 1024.0
+            prefixes = ['', 'Ki', 'Mi', 'Gi', 'Ti']
+        else:
+            divider = 1000.0
+            prefixes = ['', 'k', 'M', 'G', 'T']
         while sz > divider and len(prefixes) > 1:
             prefixes = prefixes[1:]
             sz = sz/divider
@@ -238,6 +243,21 @@ def gen_packages_csv(pkgsizes, outputf):
             wr.writerow([pkg, size, "%.1f" % (float(size) / total * 100)])
 
 
+#
+# Our special action for --iec, --binary, --si, --decimal
+#
+class PrefixAction(argparse.Action):
+    def __init__(self, option_strings, dest, **kwargs):
+        for key in ["type", "nargs"]:
+            if key in kwargs:
+                raise ValueError('"{}" not allowed'.format(key))
+        super(PrefixAction, self).__init__(option_strings, dest, nargs=0,
+                                           type=bool, **kwargs)
+
+    def __call__(self, parser, namespace, values, option_string=None):
+        setattr(namespace, self.dest, option_string in ["--iec", "--binary"])
+
+
 def main():
     parser = argparse.ArgumentParser(description='Draw size statistics graphs')
 
@@ -249,11 +269,16 @@ def main():
                         help="CSV output file with file size statistics")
     parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
                         help="CSV output file with package size statistics")
+    parser.add_argument("--iec", "--binary", "--si", "--decimal",
+                        action=PrefixAction,
+                        help="Use IEC (binary, powers of 1024) or SI (decimal, "
+                             "powers of 1000, the default) prefixes")
     parser.add_argument("--size-limit", "-l", type=float,
                         help='Under this size ratio, files are accounted to ' +
                              'the generic "Other" package. Default: 0.01 (1%%)')
     args = parser.parse_args()
 
+    Config.iec = args.iec
     if args.size_limit is not None:
         if args.size_limit < 0.0 or args.size_limit > 1.0:
             raise ValueError("--size-limit must be in [0.0..1.0]")
-- 
2.20.1

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

* [Buildroot] [PATCH 8/9] support/graph-size: add option to sort packages in reverse size order
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (6 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 7/9] support/graph-size: add option to report size with IEC prefixes Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-17 17:18 ` [Buildroot] [PATCH 9/9] support/graph-size: reorder colours assigned to sizes Yann E. MORIN
  2019-08-26 20:55 ` [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Arnout Vandecappelle
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Currently, the packages are sorted smallest first, and biggest last
(with unknown and others second-to-last and last, resp.).

Add an option to invert the ordering (but keeping unknown and others at
their current positions).

This has the nice side effect that we can now control the colours
assigned to the biggest package(s), as the colours are cycled from the
first to the last. Currently, the biggest packages gets a redish colour,
which is appropriate, but the second gets a greenish one, which is not
as appropriate (but changing that can come later).

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 docs/manual/common-usage.txt | 3 +++
 support/scripts/size-stats   | 8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/manual/common-usage.txt b/docs/manual/common-usage.txt
index 5653e85e12..a87980d4a2 100644
--- a/docs/manual/common-usage.txt
+++ b/docs/manual/common-usage.txt
@@ -329,6 +329,9 @@ to further control the generated graph. Accepted options are:
 * `--iec`, `--binary`, `--si`, `--decimal`, to use IEC (binary, powers
   of 1024) or SI (decimal, powers of 1000; the default) prefixes.
 
+* `--biggest-first`, to sort packages in decreasing size order, rather
+  than in increasing size order.
+
 .Note
 The collected filesystem size data is only meaningful after a complete
 clean rebuild. Be sure to run +make clean all+ before using +make
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 5bf0ee6e95..f6b8e6644d 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -35,6 +35,7 @@ except ImportError:
 
 
 class Config():
+    biggest_first = False
     iec = False
     size_limit = 0.01
     colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
@@ -152,7 +153,8 @@ def draw_graph(pkgsize, outputf):
     values = []
     other_value = 0
     unknown_value = 0
-    for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
+    for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1],
+                          reverse=Config.biggest_first):
         if sz < (total * Config.size_limit):
             other_value += sz
         elif p == "unknown":
@@ -269,6 +271,9 @@ def main():
                         help="CSV output file with file size statistics")
     parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
                         help="CSV output file with package size statistics")
+    parser.add_argument("--biggest-first", action='store_true',
+                        help="Sort packages in decreasing size order, " +
+                             "rather than in increasing size order")
     parser.add_argument("--iec", "--binary", "--si", "--decimal",
                         action=PrefixAction,
                         help="Use IEC (binary, powers of 1024) or SI (decimal, "
@@ -278,6 +283,7 @@ def main():
                              'the generic "Other" package. Default: 0.01 (1%%)')
     args = parser.parse_args()
 
+    Config.biggest_first = args.biggest_first
     Config.iec = args.iec
     if args.size_limit is not None:
         if args.size_limit < 0.0 or args.size_limit > 1.0:
-- 
2.20.1

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

* [Buildroot] [PATCH 9/9] support/graph-size: reorder colours assigned to sizes
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (7 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 8/9] support/graph-size: add option to sort packages in reverse size order Yann E. MORIN
@ 2019-08-17 17:18 ` Yann E. MORIN
  2019-08-26 20:55 ` [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Arnout Vandecappelle
  9 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2019-08-17 17:18 UTC (permalink / raw)
  To: buildroot

Now that we can order packages from biggest to smallest, it makes sense
to assign the most aggressive colours to the biggest packages.

As such, reorder the current colours so that we have, in order:
  - red-ish
  - orange-ish
  - yellow-ish
  - purple-ish
  - eggplant-ish (is that even a colour? :-] )
  - some-indeterminate-blue-ish
  - dark-green-ish
  - light-green-ish

For the previous, smallest-first ordering, it does not matter much what
the ordering is: the actual colours are still somewhat-unpredictably
assigned to packages, depending on the cut-off limit...

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/size-stats | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index f6b8e6644d..9cb8a33118 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -38,8 +38,8 @@ class Config():
     biggest_first = False
     iec = False
     size_limit = 0.01
-    colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
-              '#0068b5', '#f28e00', '#940084', '#97c000']
+    colors = ['#e60004', '#f28e00', '#ffed00', '#940084',
+              '#2e1d86', '#0068b5', '#009836', '#97c000']
 
 
 #
-- 
2.20.1

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

* [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings
  2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
@ 2019-08-19  2:28   ` Ricardo Martincoski
  2019-08-26 20:53   ` Arnout Vandecappelle
  1 sibling, 0 replies; 15+ messages in thread
From: Ricardo Martincoski @ 2019-08-19  2:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, Aug 17, 2019 at 02:18 PM, Yann E. MORIN wrote:

> There are three E501 warnings returned by flake8, when run locally,
> because we enforce a local 80-char limit, but that are not reported by
> the gitlab-ci jobs because only a 132-char limit is required there.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Reviewed-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>

> ---
> I initially whined loudly when this discrepancy was added, but now I
> can prove that it is bad: running flake8 on a locally-modified script
> will return errors that have not been introduced by the developer, but
> by a previous change by someone else that was not careful to run flake8
> on it... Sigh... :-(

I see your point. Some warnings that show only locally can be missed during a
code-review and are not caught by the gitlab-ci job.

But I think the rule is not the one to blame here, for this file.
You can blame me for missing those lines :-(

Those lines were added when the script was added in commit [1] by Thomas P.
Later I tried to add the config to match the 80/132 rule but I failed [2].
Then, in order to have flake8 in gitlab-ci [4], I tried to remove the existing
warnings [3] but the list of warnings I used was based on [2] so it was
incomplete for E501.
And finally the config to match the 80/132 was fixed by [5].

[1] 2015 598c80be8f support/scripts: add size-stats script
[2] 2017 918a02ce22 .flake8: add config file for Python code style
[3] 2018 493a86a7b7 size-stats: fix code style
[4] 2018 1960eda2f6 .gitlab-ci.yml: check flake8
[5] 2019 7d17ae2acf .flake8: fix check for 80/132 columns

Regards,
Ricardo

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

* [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings
  2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
  2019-08-19  2:28   ` Ricardo Martincoski
@ 2019-08-26 20:53   ` Arnout Vandecappelle
  1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2019-08-26 20:53 UTC (permalink / raw)
  To: buildroot



On 17/08/2019 19:18, Yann E. MORIN wrote:
> There are three E501 warnings returned by flake8, when run locally,
> because we enforce a local 80-char limit, but that are not reported by
> the gitlab-ci jobs because only a 132-char limit is required there.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> 
> ---
> I initially whined loudly when this discrepancy was added, but now I
> can prove that it is bad: running flake8 on a locally-modified script
> will return errors that have not been introduced by the developer, but
> by a previous change by someone else that was not careful to run flake8
> on it... Sigh... :-(

 Of course it does. Have you ever tried running checkpatch.pl on an existing
file? You'll get tons of warnings - especially for lines which are too long.
That's why checkpatch.pl takes a patch as input, and flake8 has the --diff option.

 For line length, it's very easy to fall in the category "makes the code less
readable" of PEP8 [1]. And adding a noqa at the end would make the line even
longer...

> ---
>  support/scripts/size-stats | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/support/scripts/size-stats b/support/scripts/size-stats
> index deea92e278..8dfa391e24 100755
> --- a/support/scripts/size-stats
> +++ b/support/scripts/size-stats
> @@ -66,8 +66,8 @@ def add_file(filesdict, relpath, abspath, pkg):
>  #
>  def build_package_dict(builddir):
>      filesdict = {}
> -    with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
> -        for l in filelistf.readlines():
> +    with open(os.path.join(builddir, "build", "packages-file-list.txt")) as f:
> +        for l in f.readlines():

 Here's an example where it *could* be argued that it makes the code less
readable. Well, it doesn't really make the code less readable, but it could have :-)

 Therefore, I've applied to next as is.

 Regards,
 Arnout


[1]
https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds


>              pkg, fpath = l.split(",", 1)
>              # remove the initial './' in each file path
>              fpath = fpath.strip()[2:]
> @@ -151,7 +151,8 @@ def draw_graph(pkgsize, outputf):
>      plt.setp(texts, fontproperties=proptease)
>  
>      plt.suptitle("Filesystem size per package", fontsize=18, y=.97)
> -    plt.title("Total filesystem size: %d kB" % (total / 1000.), fontsize=10, y=.96)
> +    plt.title("Total filesystem size: %d kB" % (total / 1000.), fontsize=10,
> +              y=.96)
>      plt.savefig(outputf)
>  
>  
> @@ -209,7 +210,8 @@ def gen_packages_csv(pkgsizes, outputf):
>      total = sum(pkgsizes.values())
>      with open(outputf, 'w') as csvfile:
>          wr = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_MINIMAL)
> -        wr.writerow(["Package name", "Package size", "Package size in system (%)"])
> +        wr.writerow(["Package name", "Package size",
> +                     "Package size in system (%)"])
>          for (pkg, size) in pkgsizes.items():
>              wr.writerow([pkg, size, "%.1f" % (float(size) / total * 100)])
>  
> 

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

* [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others"
  2019-08-17 17:18 ` [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others" Yann E. MORIN
@ 2019-08-26 20:53   ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2019-08-26 20:53 UTC (permalink / raw)
  To: buildroot



On 17/08/2019 19:18, Yann E. MORIN wrote:
> Currently, the "unknown" category may be reproted anywhere, so it does
> not really stand out when there are a lot of packages in the graph.
> 
> Move it towards the end, but right before the "other" category, so that
> it is a bit more visible. Like for Others, don;t report it if its size
> is zero.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ---
>  support/scripts/size-stats | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/support/scripts/size-stats b/support/scripts/size-stats
> index 398c256e8b..82258e4606 100755
> --- a/support/scripts/size-stats
> +++ b/support/scripts/size-stats
> @@ -131,12 +131,18 @@ def draw_graph(pkgsize, outputf):
>      labels = []
>      values = []
>      other_value = 0
> +    unknown_value = 0

 A slightly more pythonesque way (IMO) would be

    unknown_value = pkgsize.pop("unknown")

(assuming that pkgsize["unknown"] doesn't get used anymore).

 But opinons may vary and I couldn't be bothered with testing my change, so
applied to next as is, thanks.

 Regards,
 Arnout

>      for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
>          if sz < (total * 0.01):
>              other_value += sz
> +        elif p == "unknown":
> +            unknown_value = sz
>          else:
>              labels.append("%s (%d kB)" % (p, sz / 1000.))
>              values.append(sz)
> +    if unknown_value != 0:
> +        labels.append("Unknown (%d kB)" % (unknown_value / 1000.))
> +        values.append(unknown_value)
>      if other_value != 0:
>          labels.append("Other (%d kB)" % (other_value / 1000.))
>          values.append(other_value)
> 

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

* [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others
  2019-08-17 17:18 ` [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others Yann E. MORIN
@ 2019-08-26 20:53   ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2019-08-26 20:53 UTC (permalink / raw)
  To: buildroot



On 17/08/2019 19:18, Yann E. MORIN wrote:
> Currently, we group packages that contribute less then 1%, into the
> "Other" category.
> 
> However, in some cases, there can be a lot of very comparatively small
> packages, and they may not exceed this limit, and so only the "Others"
> category would be displayed, which is not nice.
> 
> Conversely, if there are a lot of packages, most of which only so
> slightly exceeding this limit, then we get all of them in the graph,
> which is not nice either.
> 
> Add a way for the developers to pass a different cut-off limit. As for
> the dependency graph which has BR2_GRAPH_DEPS_OPTS, add the environment
> variable BR2_GRAPH_SIZE_OPTS to carry those extra option (in preparation
> for more to come, later).
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ---
[snip]
> diff --git a/support/scripts/size-stats b/support/scripts/size-stats
> index eb09e0dc60..3454acd681 100755
> --- a/support/scripts/size-stats
> +++ b/support/scripts/size-stats
> @@ -33,8 +33,11 @@ except ImportError:
>      sys.stderr.write("You need python-matplotlib to generate the size graph\n")
>      exit(1)
>  
> -colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
> -          '#0068b5', '#f28e00', '#940084', '#97c000']
> +
> +class Config():

 If there's no base class, don't add the ().

> +    size_limit = 0.01
> +    colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
> +              '#0068b5', '#f28e00', '#940084', '#97c000']
>  
>  
>  #
> @@ -145,7 +148,7 @@ def draw_graph(pkgsize, outputf):
>      other_value = 0
>      unknown_value = 0
>      for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
> -        if sz < (total * 0.01):
> +        if sz < (total * Config.size_limit):
>              other_value += sz
>          elif p == "unknown":
>              unknown_value = sz
> @@ -162,7 +165,7 @@ def draw_graph(pkgsize, outputf):
>      plt.figure()
>      patches, texts, autotexts = plt.pie(values, labels=labels,
>                                          autopct='%1.1f%%', shadow=True,
> -                                        colors=colors)
> +                                        colors=Config.colors)
>      # Reduce text size
>      proptease = fm.FontProperties()
>      proptease.set_size('xx-small')
> @@ -246,8 +249,16 @@ def main():
>                          help="CSV output file with file size statistics")
>      parser.add_argument("--package-size-csv", '-p', metavar="PKG_SIZE_CSV",
>                          help="CSV output file with package size statistics")
> +    parser.add_argument("--size-limit", "-l", type=float,
> +                        help='Under this size ratio, files are accounted to ' +
> +                             'the generic "Other" package. Default: 0.01 (1%%)')
>      args = parser.parse_args()
>  
> +    if args.size_limit is not None:
> +        if args.size_limit < 0.0 or args.size_limit > 1.0:
> +            raise ValueError("--size-limit must be in [0.0..1.0]")

 ValueError is appropriate if you define an argument handler function. If you do
the checks afterwards, you should use parser.error instead.

 Fixed both and applied to next, thanks

 Regards,
 Arnout

> +        Config.size_limit = args.size_limit
> +
>      # Find out which package installed what files
>      pkgdict = build_package_dict(args.builddir)
>  
> 

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

* [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size)
  2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
                   ` (8 preceding siblings ...)
  2019-08-17 17:18 ` [Buildroot] [PATCH 9/9] support/graph-size: reorder colours assigned to sizes Yann E. MORIN
@ 2019-08-26 20:55 ` Arnout Vandecappelle
  9 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2019-08-26 20:55 UTC (permalink / raw)
  To: buildroot



On 17/08/2019 19:18, Yann E. MORIN wrote:
> Hello All!
> 
> This series brings in a few improvements to the graph-size feature:
> 
>   - add option to inverse the ordering
>   - add option to use IEC or SI prefixes (binary / decimal)
>   - add option to change the cut-off grouping limit
>   - shuffle the colours to better represent bigger packages
>   - hide Others and Unknown if empty
>   - some flake8 fixes and other cleanups

 Series applied to next, with a few small changes as indicated in individual
replies, and a bunch of typo fixes in commit message that I didn't bother to
indicate.

 Thanks!

 Regards,
 Arnout

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

end of thread, other threads:[~2019-08-26 20:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17 17:18 [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 1/9] support/graph-size: fix flake8 warnings Yann E. MORIN
2019-08-19  2:28   ` Ricardo Martincoski
2019-08-26 20:53   ` Arnout Vandecappelle
2019-08-17 17:18 ` [Buildroot] [PATCH 2/9] support/graph-size: introduce main() Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 3/9] support/graph-size: don't report "Others" if size is zero Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 4/9] support/graph-size: report 'Unkown" after all packages, but before "Others" Yann E. MORIN
2019-08-26 20:53   ` Arnout Vandecappelle
2019-08-17 17:18 ` [Buildroot] [PATCH 5/9] support/graph-size: display human-readable size Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 6/9] support/graph-size: add option to change percentage to group in Others Yann E. MORIN
2019-08-26 20:53   ` Arnout Vandecappelle
2019-08-17 17:18 ` [Buildroot] [PATCH 7/9] support/graph-size: add option to report size with IEC prefixes Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 8/9] support/graph-size: add option to sort packages in reverse size order Yann E. MORIN
2019-08-17 17:18 ` [Buildroot] [PATCH 9/9] support/graph-size: reorder colours assigned to sizes Yann E. MORIN
2019-08-26 20:55 ` [Buildroot] [PATCH 0/9] support/graph-soze: misc improvements (branch yem/graph-size) Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.