All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/scripts: sort pie charts
@ 2018-01-02 14:07 Thomas De Schampheleire
  2018-01-02 21:40 ` Thomas Petazzoni
  2018-01-08 21:49 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas De Schampheleire @ 2018-01-02 14:07 UTC (permalink / raw)
  To: buildroot

Make sure that the pie charts produced by 'graph-build' and 'graph-size'
targets are sorted on the size of each piece of the pie. Otherwise, making
visual analysis is difficult, as one needs to look at the legends of each
piece and do the sorting manually in their head.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 support/scripts/graph-build-time | 2 +-
 support/scripts/size-stats       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index 0ba0f2d3a7..9d05f2257a 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -184,7 +184,7 @@ def pkg_pie_time_per_package(data, output):
     labels = []
     values = []
     other_value = 0
-    for p in data:
+    for p in sorted(data, key=lambda p: p.get_duration()):
         if p.get_duration() < (total * 0.01):
             other_value += p.get_duration()
         else:
diff --git a/support/scripts/size-stats b/support/scripts/size-stats
index 3ff2a1ce18..85e7c1596b 100755
--- a/support/scripts/size-stats
+++ b/support/scripts/size-stats
@@ -127,7 +127,7 @@ def draw_graph(pkgsize, outputf):
     labels = []
     values = []
     other_value = 0
-    for (p, sz) in pkgsize.items():
+    for (p, sz) in sorted(pkgsize.items(), key=lambda x: x[1]):
         if sz < (total * 0.01):
             other_value += sz
         else:
-- 
2.13.6

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

* [Buildroot] [PATCH 1/1] support/scripts: sort pie charts
  2018-01-02 14:07 [Buildroot] [PATCH 1/1] support/scripts: sort pie charts Thomas De Schampheleire
@ 2018-01-02 21:40 ` Thomas Petazzoni
  2018-01-08 21:49 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-01-02 21:40 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 2 Jan 2018 15:07:23 +0100, Thomas De Schampheleire wrote:
> Make sure that the pie charts produced by 'graph-build' and 'graph-size'
> targets are sorted on the size of each piece of the pie. Otherwise, making
> visual analysis is difficult, as one needs to look at the legends of each
> piece and do the sorting manually in their head.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ---
>  support/scripts/graph-build-time | 2 +-
>  support/scripts/size-stats       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

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

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

* [Buildroot] [PATCH 1/1] support/scripts: sort pie charts
  2018-01-02 14:07 [Buildroot] [PATCH 1/1] support/scripts: sort pie charts Thomas De Schampheleire
  2018-01-02 21:40 ` Thomas Petazzoni
@ 2018-01-08 21:49 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-01-08 21:49 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> writes:

 > Make sure that the pie charts produced by 'graph-build' and 'graph-size'
 > targets are sorted on the size of each piece of the pie. Otherwise, making
 > visual analysis is difficult, as one needs to look at the legends of each
 > piece and do the sorting manually in their head.

 > Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Committed to 2017.11.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2018-01-08 21:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 14:07 [Buildroot] [PATCH 1/1] support/scripts: sort pie charts Thomas De Schampheleire
2018-01-02 21:40 ` Thomas Petazzoni
2018-01-08 21:49 ` Peter Korsgaard

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.