Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block
@ 2014-09-13  3:14 Danomi Manchego
  2014-09-13  3:14 ` [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional Danomi Manchego
  2014-09-14 22:08 ` [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Danomi Manchego @ 2014-09-13  3:14 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

---

Like the manual says in 'The .mk file' section ...

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index d04fd36..4b6d818 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -56,11 +56,11 @@ endef
 GLOBAL_INSTRUMENTATION_HOOKS += step_time
 
 # User-supplied script
+ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
 define step_user
 	@$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \
 		$(EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep))
 endef
-ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
 GLOBAL_INSTRUMENTATION_HOOKS += step_user
 endif
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional
  2014-09-13  3:14 [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Danomi Manchego
@ 2014-09-13  3:14 ` Danomi Manchego
  2014-09-14 22:11   ` Yann E. MORIN
  2014-09-14 22:08 ` [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Yann E. MORIN
  1 sibling, 1 reply; 4+ messages in thread
From: Danomi Manchego @ 2014-09-13  3:14 UTC (permalink / raw)
  To: buildroot

Commit 17d4eb1e0261793a9f89e4a2253602c7ab926d2e added a hook to log timing
of steps to a build-time.log file, which provides data for the "graph-build"
target for examining build time stats.  If one uses buildroot on a daily
basis as part of a build system, then its conceivable that there might be
long periods of time between "make clean" ops.  So the log file continues
to grow.  This patch makes the accumulation of the timing data optional, to
avoid having a silent endlessly growing log in the build directory.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 Config.in              | 6 ++++++
 package/pkg-generic.mk | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/Config.in b/Config.in
index 14ff55b..78ee165 100644
--- a/Config.in
+++ b/Config.in
@@ -574,6 +574,12 @@ config BR2_GLOBAL_PATCH_DIR
 	  Otherwise, if the directory <global-patch-dir>/<packagename> exists,
 	  then all *.patch files in the directory will be applied.
 
+config BR2_GATHER_BUILD_TIME_STATS
+	bool "Gather build time statistics"
+	help
+	  Record the start and end time of each step in the build process, so
+	  that buildroot can generate graphs of the build times.
+
 endmenu
 
 source "toolchain/Config.in"
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 4b6d818..5f0256e 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -48,12 +48,14 @@ endef
 # Actual steps hooks
 
 # Time steps
+ifneq ($(BR2_GATHER_BUILD_TIME_STATS),)
 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
+endif
 
 # User-supplied script
 ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block
  2014-09-13  3:14 [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Danomi Manchego
  2014-09-13  3:14 ` [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional Danomi Manchego
@ 2014-09-14 22:08 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2014-09-14 22:08 UTC (permalink / raw)
  To: buildroot

Danomi, All,

On 2014-09-12 23:14 -0400, Danomi Manchego spake thusly:
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
> 
> Like the manual says in 'The .mk file' section ...
> 
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
> ---
>  package/pkg-generic.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index d04fd36..4b6d818 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -56,11 +56,11 @@ endef
>  GLOBAL_INSTRUMENTATION_HOOKS += step_time
>  
>  # User-supplied script
> +ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
>  define step_user
>  	@$(foreach user_hook, $(BR2_INSTRUMENTATION_SCRIPTS), \
>  		$(EXTRA_ENV) $(user_hook) "$(1)" "$(2)" "$(3)"$(sep))
>  endef
> -ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
>  GLOBAL_INSTRUMENTATION_HOOKS += step_user
>  endif
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional
  2014-09-13  3:14 ` [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional Danomi Manchego
@ 2014-09-14 22:11   ` Yann E. MORIN
  0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2014-09-14 22:11 UTC (permalink / raw)
  To: buildroot

Danomi, All,

On 2014-09-12 23:14 -0400, Danomi Manchego spake thusly:
> Commit 17d4eb1e0261793a9f89e4a2253602c7ab926d2e added a hook to log timing
> of steps to a build-time.log file, which provides data for the "graph-build"
> target for examining build time stats.  If one uses buildroot on a daily
> basis as part of a build system, then its conceivable that there might be
> long periods of time between "make clean" ops.  So the log file continues
> to grow.  This patch makes the accumulation of the timing data optional, to
> avoid having a silent endlessly growing log in the build directory.

Well, it is ever growing, indeed, but its size is not that much, when
compared to the other generated artifacts:

    $ du -hs output
    1.7G    .
    $ ls -lh output/build/build-time.log
    -rw-rw-r-- 1 ymorin ymorin 33K Sep 14 23:55 output/build/build-time.log

But OK on principle. See a comment below...

[--SNIP--]
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 4b6d818..5f0256e 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -48,12 +48,14 @@ endef
>  # Actual steps hooks
>  
>  # Time steps
> +ifneq ($(BR2_GATHER_BUILD_TIME_STATS),)

Please use positive logic:

    ifeq ($(BR2_GATHER_BUILD_TIME_STATS),y)

Regards,
Yann E. MORIN.

>  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
> +endif
>  
>  # User-supplied script
>  ifneq ($(BR2_INSTRUMENTATION_SCRIPTS),)
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-14 22:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-13  3:14 [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Danomi Manchego
2014-09-13  3:14 ` [Buildroot] [PATCH 2/2] pkg-infra: make timing of steps optional Danomi Manchego
2014-09-14 22:11   ` Yann E. MORIN
2014-09-14 22:08 ` [Buildroot] [PATCH 1/2] pkg-infra: put optional step_user def and assignment in one block Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox