manual: minor fixes in the graph-size documentation
PATCH v2 1/2 manual: minor fixes in the graph-size documentation
From: Thomas De Schampheleire <[email protected]>
Fix some typos and references to a size-stats 'target' (the script is called 'size-stats' but the make target is 'graph-size').
--- docs/manual/common-usage.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
docs/manual/common-usage.txt +4 -4
@@ -282,7 +282,7 @@ When your target system grows, it is sometimes useful to understand how much each Buildroot package is contributing to the overall root filesystem size. To help with such an analysis, Buildroot collects data about files installed by each package and using this data, -generates a graph and CSVs files detailing the size contribution of +generates a graph and CSV files detailing the size contribution of the different packages. To generate these data after a build, run:
@@ -303,9 +303,9 @@ This will generate: contribution of each installed file to the package it belongs, and to the overall filesystem size. -This +size-stats+ target requires the Python Matplotlib library to be +This +graph-size+ target requires the Python Matplotlib library to be installed (+python-matplotlib+ on most distributions), and also the -+argpase+ module if you're using a Python version older than 2.7 ++argparse+ module if you're using a Python version older than 2.7 (+python-argparse+ on most distributions). Just like for the duration graph, a +BR2_GRAPH_OUT+ environment is
@@ -315,7 +315,7 @@ for details about this environment variable. .Note The collected filesystem size data is only meaningful after a complete clean rebuild. Be sure to run +make clean all+ before using +make -size-stats+. +graph-size+. include::eclipse-integration.txt[]
Signature · 1 line
2.4.10
PATCH v2 2/2 support/scripts: add size-stats-compare script
From: Thomas De Schampheleire <[email protected]>
Leverage the CSV files produces by size-stats (make graph-size) to allow for a comparison of rootfs size between two different buildroot compilations.
The script takes the file-size CSV files of two compilations as input, and produces a textual report of the differences per package. Using the -d/--detail flag, the report will show the file size changes instead of package size changes.
The -t/--threshold option allows to ignore file size differences smaller or equal than the given threshold (in bytes).
--- docs/manual/common-usage.txt | 10 +++ support/scripts/size-stats-compare | 129 +++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100755 support/scripts/size-stats-compare
v2:
Addressing Arnout's comments:
- improve help text
- remove references to commits-to-be-backported
- fix references to 'package' while really file or package could be meant
- verify header of CSV file is as expected
- don't print output header for sections that are empty
- use <= instead of < for threshold
- use argparse.Filetype for file path verification
- use positional args for input files
- improve string wrapping
- add reference to script in manual
- ensure Python 3 compatibility
Other changes:
- also print out total size difference
- add docstrings to methods
- add TODO with possible improvements
docs/manual/common-usage.txt +10 -0
@@ -317,6 +317,16 @@ The collected filesystem size data is only meaningful after a complete clean rebuild. Be sure to run +make clean all+ before using +make graph-size+. +To compare the root filesystem size of two different Buildroot compilations, +for example after adjusting the configuration or when switching to another +Buildroot release, use the +size-stats-compare+ script. It takes two ++file-size-stats.csv+ files (produced by +make graph-size+) as input. +Refer to the help text of this script for more details: + +---------------- +support/scripts/size-stats-compare -h +---------------- + include::eclipse-integration.txt[] include::advanced.txt[]
support/scripts/size-stats-compare new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
2.4.10
PATCH v2 2/2 support/scripts: add size-stats-compare script
Thomas,
Quoted 13 lines · Thomas De Schampheleire
From: Thomas De Schampheleire <[email protected]>
Leverage the CSV files produces by size-stats (make graph-size) to allow for a comparison of rootfs size between two different buildroot compilations.
The script takes the file-size CSV files of two compilations as input, and produces a textual report of the differences per package. Using the -d/--detail flag, the report will show the file size changes instead of package size changes.
The -t/--threshold option allows to ignore file size differences smaller or equal than the given threshold (in bytes).
Quoted 6 lines
Signed-off-by Thomas De Schampheleire <[email protected]>--- docs/manual/common-usage.txt | 10 +++ support/scripts/size-stats-compare | 129 +++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100755 support/scripts/size-stats-compare
I tested your patch, overall looks good to me, but I have two comments:
(1) I find the order of the arguments for the two CSV files to be confusing. If you have a "before" situation, and then an "after" situation you want to compare, you need to call:
size-stats-compare after-situation.csv before-situation.csv
Which isn't very intuitive nor matching what "diff" is doing for example. So I would suggest to invert those two arguments. And in the code, instead of having "sizes" and "other_sizes", use something more explicit like "before_sizes", "after_sizes", or "first_sizes", "second_sizes", etc.
(2) For the output, I would rather see a single table, maybe looking
more or less like:
1032987 foobar
289792 added strace
65576 busybox
0 skeleton
0 toolchain-external
0 initscripts
-68692 removed zlib
---- ----- -----
292908 TOTAL
(Numbers are completely made up)Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/2 manual: minor fixes in the graph-size documentation
In reply to Thomas De SchampheleireThomas,
Quoted 4 lines · Thomas De Schampheleire
From: Thomas De Schampheleire <[email protected]>
Fix some typos and references to a size-stats 'target' (the script is called 'size-stats' but the make target is 'graph-size').
Yeah, I renamed the target a few times, and forgot to fix it everywhere it seems.
Quoted 2 lines
Signed-off-by Thomas De Schampheleire <[email protected]>
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Thomas Petazzoni
AppliedPATCH v2 1/2 manual: minor fixes in the graph-size documentation
In reply to Thomas De SchampheleireDear Thomas De Schampheleire,
Quoted 9 lines · Thomas De Schampheleire
From: Thomas De Schampheleire <[email protected]>
Fix some typos and references to a size-stats 'target' (the script is called 'size-stats' but the make target is 'graph-size').
Signed-off-by Thomas De Schampheleire <[email protected]>--- docs/manual/common-usage.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com