summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2013-11-11 15:03:28 (GMT)
committer Peter Korsgaard <peter@korsgaard.com>2013-11-12 23:26:27 (GMT)
commit17d4eb1e0261793a9f89e4a2253602c7ab926d2e (patch)
tree865d41adf19d108be51cbec040f697d0da083bcf
parentacd394ae0c60910cb63485e143ed39c8f1bdecf2 (diff)
downloadbuildroot-17d4eb1e0261793a9f89e4a2253602c7ab926d2e.tar.gz
buildroot-17d4eb1e0261793a9f89e4a2253602c7ab926d2e.tar.bz2
pkg-infra: add hook to log timing of steps
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>
-rw-r--r--package/pkg-generic.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 073cff3..619974e 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -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
################################################################################