[LEDE-DEV] [PATCH] [RFC] build: log time taken by each packages/steps

Etienne Champetier champetier.etienne at gmail.com
Sat Jan 20 15:01:33 PST 2018


The idea is to easily get the list of packages taking the most time to build,
and see if we can improve them

Sending as RFC as this is a quick hack that might break in some case (different implementation of time)

Signed-off-by: Etienne Champetier <champetier.etienne at gmail.com>
---
 include/subdir.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/subdir.mk b/include/subdir.mk
index 79a80528ae..85d2daf1bd 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -42,7 +42,8 @@ log_make = \
 	 $(if $(call debug,$(1),v),,@)+ \
 	 $(if $(BUILD_LOG), \
 		set -o pipefail; \
-		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
+		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4)); \
+		/usr/bin/time -f $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#\#%U\#%S\#%e -a -o $(BUILD_LOG_DIR)/time.txt -- ) \
 	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \
 		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)
 
-- 
2.14.3




More information about the Lede-dev mailing list