diff mbox

[PATCHv5,3/4] Makefile: implement a size-stats target

Message ID 1441228505-23235-4-git-send-email-thomas.petazzoni@free-electrons.com
State Superseded
Headers show

Commit Message

Thomas Petazzoni Sept. 2, 2015, 9:15 p.m. UTC
This commit implements a size-stats target that calls the script of
the same name to generate the graph and CSV files related to package
and file sizes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Ryan Barnett <ryanbarnett3@gmail.com>
Tested-by: Ryan Barnett <ryanbarnett3@gmail.com>
---
 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Yann E. MORIN Sept. 3, 2015, 10:29 a.m. UTC | #1
Thomas, All,

On 2015-09-02 23:15 +0200, Thomas Petazzoni spake thusly:
> This commit implements a size-stats target that calls the script of
> the same name to generate the graph and CSV files related to package
> and file sizes.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Reviewed-by: Ryan Barnett <ryanbarnett3@gmail.com>
> Tested-by: Ryan Barnett <ryanbarnett3@gmail.com>

Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

I would however have called this something like graph-sizes, so it is in
line with the other graph-generating targets.

Otherwise:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  Makefile | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 9a6e9c0..4a33495 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -685,6 +685,13 @@ graph-depends: graph-depends-requirements
>  	|tee $(GRAPHS_DIR)/$(@).dot \
>  	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT)
>  
> +size-stats:
> +	$(Q)mkdir -p $(GRAPHS_DIR)
> +	$(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
> +		--graph $(BASE_DIR)/graphs/graph-size.$(BR_GRAPH_OUT) \
> +		--file-size-csv $(BASE_DIR)/build/file-size-stats.csv \
> +		--package-size-csv $(BASE_DIR)/build/package-size-stats.csv
> +
>  else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
>  
>  all: menuconfig
> @@ -903,6 +910,7 @@ endif
>  	@echo '  manual-epub            - build manual in ePub'
>  	@echo '  graph-build            - generate graphs of the build times'
>  	@echo '  graph-depends          - generate graph of the dependency tree'
> +	@echo '  size-stats             - generate stats of the filesystem size'
>  	@echo '  list-defconfigs        - list all defconfigs (pre-configured minimal systems)'
>  	@echo
>  	@echo 'Miscellaneous:'
> -- 
> 2.5.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Sept. 3, 2015, 12:21 p.m. UTC | #2
Dear Yann E. MORIN,

On Thu, 3 Sep 2015 12:29:05 +0200, Yann E. MORIN wrote:

> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks!

> I would however have called this something like graph-sizes, so it is in
> line with the other graph-generating targets.

It used to be called graph-size, until I changed the code to also
generate CSV files. So now it doesn't generate just a graph, but also
raw CSV data, which is why I changed to size-stats. If despite that
you think "make graph-size" remains a better naming, I'm fine with
changing back.

Thomas
Yann E. MORIN Sept. 3, 2015, 12:36 p.m. UTC | #3
Thomas, All,

On 2015-09-03 14:21 +0200, Thomas Petazzoni spake thusly:
> On Thu, 3 Sep 2015 12:29:05 +0200, Yann E. MORIN wrote:
[--SNIP--]
> > I would however have called this something like graph-sizes, so it is in
> > line with the other graph-generating targets.
> 
> It used to be called graph-size, until I changed the code to also
> generate CSV files. So now it doesn't generate just a graph, but also
> raw CSV data, which is why I changed to size-stats. If despite that
> you think "make graph-size" remains a better naming, I'm fine with
> changing back.

Well, can't we consider the csv files as by-products? The main and
primary purpose is to generate the graphs, so I'd still call that
graph-size. Having 'graph-' as a prefix also helps classify the rule
with the other graph-generating rules.

But I don't really mind...

Regards,
Yann E. MORIN.
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 9a6e9c0..4a33495 100644
--- a/Makefile
+++ b/Makefile
@@ -685,6 +685,13 @@  graph-depends: graph-depends-requirements
 	|tee $(GRAPHS_DIR)/$(@).dot \
 	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(GRAPHS_DIR)/$(@).$(BR_GRAPH_OUT)
 
+size-stats:
+	$(Q)mkdir -p $(GRAPHS_DIR)
+	$(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
+		--graph $(BASE_DIR)/graphs/graph-size.$(BR_GRAPH_OUT) \
+		--file-size-csv $(BASE_DIR)/build/file-size-stats.csv \
+		--package-size-csv $(BASE_DIR)/build/package-size-stats.csv
+
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
@@ -903,6 +910,7 @@  endif
 	@echo '  manual-epub            - build manual in ePub'
 	@echo '  graph-build            - generate graphs of the build times'
 	@echo '  graph-depends          - generate graph of the dependency tree'
+	@echo '  size-stats             - generate stats of the filesystem size'
 	@echo '  list-defconfigs        - list all defconfigs (pre-configured minimal systems)'
 	@echo
 	@echo 'Miscellaneous:'