From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnout Vandecappelle Date: Tue, 11 Oct 2011 07:59:22 +0200 Subject: [Buildroot] [PATCH 1/2] package: instrument to gather timing data In-Reply-To: <0cbf021419332c37bd77e661c97cfc881329f1bb.1318176666.git.thomas.petazzoni@free-electrons.com> References: <0cbf021419332c37bd77e661c97cfc881329f1bb.1318176666.git.thomas.petazzoni@free-electrons.com> Message-ID: <201110110759.23066.arnout@mind.be> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On Sunday 09 October 2011 18:17:27, Thomas Petazzoni wrote: > Instrument the package infrastructure to generate a > $(O)/build-time.data file which contains one line for each step of > each package and the corresponding duration in milliseconds. > > The instrumentation is not perfect yet, as it doesn't account for > packages with overriden source directory Why is that relevant? The output goes to $(O) anyway. But this makes me think: wouldn't it be better to > and the build-time.data is > never removed, so results will accumulate if several partial builds > are done. I would call that a feature :-) Partial builds typically mean that you're hacking away at some package, and then it's very relevant to see the impact on build time. Of course, there would need to be a target buildtime-clean that removes the files. > > Signed-off-by: Thomas Petazzoni > --- > package/Makefile.package.in | 28 ++++++++++++++++++++++++++++ > 1 files changed, 28 insertions(+), 0 deletions(-) > > diff --git a/package/Makefile.package.in b/package/Makefile.package.in > index b5ef57b..605b518 100644 > --- a/package/Makefile.package.in > +++ b/package/Makefile.package.in > @@ -254,6 +254,18 @@ define sep > > endef > > +define savetime > + echo $$(($$(date +%s%N)/1000000)) > $(O)/.br.time > +endef > + > +define outputtime > + newtime=`echo $$(($$(date +%s%N)/1000000))` ; \ > + oldtime=`cat $(O)/.br.time` ; \ > + rm -f .br.time ; \ > + timediff=$$(($$newtime-$$oldtime)) ; \ > + echo "$(1),$(2),$$timediff" >> $(O)/build-time.data Is there a particular reason to use a make function parameter in a place like this instead of using $($(PKG)_NAME) directly? I've seen this in other places in buildroot as well... [snip] Regards, Arnout -- Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43 -------------- next part -------------- An HTML attachment was scrubbed... URL: