Message ID | 20180120230133.17250-1-champetier.etienne@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | John Crispin |
Headers | show |
Series | [LEDE-DEV,RFC] build: log time taken by each packages/steps | expand |
On 21/01/18 00:01, Etienne Champetier wrote: > 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@gmail.com> Hi Etienne, the time command should be set up in include/prereq-build.mk, the SetupHostCommand. might also make sense to just print the time on the shell, always ... and not only when LOG is enabled John > --- > 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) >
Hi John, agreed, I was pretty sure there was/is a better way ;) i'll not have any time until next week, so if you or anyone want to implement it please do Regards Etienne 2018-01-22 9:23 GMT+01:00 John Crispin <john@phrozen.org>: > > > On 21/01/18 00:01, Etienne Champetier wrote: >> >> 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@gmail.com> > > > Hi Etienne, > > the time command should be set up in include/prereq-build.mk, the > SetupHostCommand. > might also make sense to just print the time on the shell, always ... and > not only when LOG is enabled > > John > > >> --- >> 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) >> > >
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)
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@gmail.com> --- include/subdir.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)