pkg-infra: add hook to log timing of steps
authorYann E. MORIN <yann.morin.1998@free.fr>
Mon, 11 Nov 2013 15:03:28 +0000 (16:03 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 12 Nov 2013 23:26:27 +0000 (00:26 +0100)
The timing information is stored in the file $(O)/build-time.log

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-generic.mk

index 073cff3d0378692dad129a8ef489784e4d4b221b..619974e167dff0a59b7119458e636f1051f9a7d0 100644 (file)
@@ -44,6 +44,17 @@ define step_end
        $(foreach hook,$(GLOBAL_INSTRUMENTATION_HOOKS),$(call $(hook),end,$(1),$($(PKG)_NAME))$(sep))
 endef
 
+#######################################
+# Actual steps hooks
+
+# Time steps
+define step_time
+       printf "%s:%-5.5s:%-20.20s: %s\n"           \
+              "$$(date +%s)" "$(1)" "$(2)" "$(3)"  \
+              >>"$(BUILD_DIR)/build-time.log"
+endef
+GLOBAL_INSTRUMENTATION_HOOKS += step_time
+
 ################################################################################
 # Implicit targets -- produce a stamp file for each step of a package build
 ################################################################################