Logging and bc. [Was: Re: r3353]

Ag. D. Hatzimanikas a.hatzim at gmail.com
Tue May 22 09:08:05 PDT 2007

On Mon, May 21, at 09:49 M.Canales.es wrote:
> But of course, the time call is forked during the full package build, while 
> the others not ...
> Maybe we should to implement both, the "time by perl" and "bc by perl" changes 
> at the same time.
> Could one of you create a new patch implementing both changes? I can try do 
> it, but maybe not until the next weekend.

Just some notes in public.

If we are going to use Dan's patch as it is (with a small exception), 
the procedure is the following.

First we define the start of the build with:

start=`date +%s` #We don't want the nanoseconds here as Dan posted in his patch.
and the end with:
end=`date +%s`

We take the difference and define the totalseconds:
TOTALSECONDS=`perl -e  'print '$end' - '$start', "\n"'`

Then we define the minutes:
#and the seconds.
#Be careful not to mess with the internal Bash variable, that is SECONDS.
#and the SBU:
SBU=`perl -e 'printf "%.3f\n" , ('$TOTALSECONDS' / '$SBU_UNIT', "\n")';`

Which produce for instance the following.
Taken from longest last build, that is first pass of gcc.

SBU_UNIT=176	 	#first pass of binutils

echo -e "Build time is: $MINUTES minutes and $SECS seconds"
Build time is:	26 minutes and 2 seconds
echo -e "Build time in seconds is: $TOTALSECONDS"
Build time in seconds is: 1562
echo -e "Approximate SBU time is:$SBU"
Approximate SBU time is: 8.875

I really think that doesn't deserve more work or mental thought, than we already
did, for that matter.
Too much effort for a little gain and for a task (SBU) that doesn't look important.
My main concern in this, was to drop bc as dependency.
Either way is fine.

More information about the alfs-discuss mailing list