build: log time taken by each packages/steps
The idea is to easily get the list of packages taking the most time to build, and see if we can improve them v1: Use SetupHostCommand as recommended by John v2: add space after 'time:', remove useless /usr/bin/time from SetupHostCommand Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
		 Etienne Champetier
					Etienne Champetier
				
			
				
					committed by
					
						 John Crispin
						John Crispin
					
				
			
			
				
	
			
			
			 John Crispin
						John Crispin
					
				
			
						parent
						
							f87dff8f72
						
					
				
				
					commit
					ff6e62b288
				
			| @@ -138,6 +138,10 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \ | |||||||
| $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ | $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ | ||||||
| 	wget --version | grep GNU)) | 	wget --version | grep GNU)) | ||||||
|  |  | ||||||
|  | $(eval $(call SetupHostCommand,gtime,Please install GNU 'time', \ | ||||||
|  | 	gtime --version 2>&1 | grep GNU, \ | ||||||
|  | 	time --version 2>&1 | grep GNU)) | ||||||
|  |  | ||||||
| $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ | $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ | ||||||
| 	perl --version | grep "perl.*v5")) | 	perl --version | grep "perl.*v5")) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -43,6 +43,7 @@ log_make = \ | |||||||
| 	 $(if $(BUILD_LOG), \ | 	 $(if $(BUILD_LOG), \ | ||||||
| 		set -o pipefail; \ | 		set -o pipefail; \ | ||||||
| 		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ | 		mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ | ||||||
|  | 	gtime -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \ | ||||||
| 	$$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ | 	$$(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) | 		$(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user