lunar info - possible to show compile-time?

 
Post new topic   Reply to topic    Lunar-Linux Forum Index -> Core Tools
View previous topic :: View next topic  
Author Message
tmaterne



Joined: 03 Mar 2006
Posts: 4
Location: Berlin - Germany

PostPosted: Fri Mar 03, 2006 7:10 pm    Post subject: lunar info - possible to show compile-time? Reply with quote

Hello,
I'm sorry if my english isn't the best but it's not my native language.

Before 10 min, I discovered the >info< option of the >lunar< command,
nice function, but there was one thing I missed:
Is it possible to show me the time a module needed compiling, the last time?

If not, I would suggest to think about such a line in the output of the info-option of lunar.
Or maybe an extra option??? Smile

Thank you for reading!
Torsten
Back to top
View user's profile Send private message
sofar



Joined: 11 Aug 2005
Posts: 172

PostPosted: Sun Mar 05, 2006 6:40 am    Post subject: Reply with quote

will be added shortly to 'theedge'.
Back to top
View user's profile Send private message Send e-mail
tmaterne



Joined: 03 Mar 2006
Posts: 4
Location: Berlin - Germany

PostPosted: Sun Mar 05, 2006 12:24 pm    Post subject: Reply with quote

Nice, but what is 'theedge'?
Back to top
View user's profile Send private message
sofar



Joined: 11 Aug 2005
Posts: 172

PostPosted: Sun Mar 05, 2006 6:15 pm    Post subject: theedge == Reply with quote

http://wiki.lunar-linux.org/index.php/Theedge
Back to top
View user's profile Send private message Send e-mail
tmaterne



Joined: 03 Mar 2006
Posts: 4
Location: Berlin - Germany

PostPosted: Sun Mar 05, 2006 9:01 pm    Post subject: Reply with quote

Thank you, so I'll install Theedge.
Nice Support!

Thanks
Back to top
View user's profile Send private message
engelsman



Joined: 21 Aug 2005
Posts: 131
Location: Netherlands

PostPosted: Sun Oct 29, 2006 9:32 am    Post subject: script: total compile times of installed modules Reply with quote

I'm running the lunar coretools rather than theedge and I wrote this script to calculate the total compile times of all installed modules, because I was curious to give an estimate of how long it would take to rebuild my system from scratch. This considers compilation time only, not download, preparation and archiving, so it would actually take longer. In the spirit of open source, I offer the script here. I hope the web page engine doesn't eat any crucial characters. Enjoy!
Code:

#!/usr/bin/env python

import commands
import csv
import datetime
import os
import sys
import time

def extractTime(line):
    for fields in csv.reader([line], delimiter=' '):
        xxx = time.strptime(fields[-1], "%a %b %d %H:%M:%S %Z %Y")
    return datetime.datetime(*xxx[0:6])
   
def getModules():
    command = 'lvu installed | cut -d: -f1'
    output = commands.getoutput(command)
    return output.split(os.linesep)
   
def getCompileTimes(module):
    command = 'lvu compile %s | grep "^++ Mark Compile st"' % (module,)
    output = commands.getoutput(command)
    return output.split(os.linesep)
   
def createDB(modules):
    database = {}
    for module in modules:
        lines = getCompileTimes(module)
        if len(lines) == 2:                 # should have start and stop lines
            try:
                t0 = extractTime(lines[0])
                t1 = extractTime(lines[1])
                database[t0] = (module, t0, t1, t1-t0)
            except ValueError:
                # can't extract times, eg moonbase, so ignore
                pass
    return database
   
def maxNameLen(title, modules):
    maxLen = len(title)
    for module in modules:
        if maxLen < len(module):
            maxLen = len(module)
    return maxLen
   
def main():       
    modules = getModules()
    database = createDB(modules)   
    if len(database) == 0:
        sys.exit(0)       
    nameLen = maxNameLen('Module', modules)
    startTimes = database.keys()
    startTimes.sort()
    blank = ' '*len(str(startTimes[0]))
    dtotal = datetime.timedelta()   
    print '%*s ! %*s ! %*s ! %s' % (nameLen, 'Module',
            len(blank), 'Compile started', len(blank), 'Compile stopped',
            'Duration')
    for startTime in startTimes:
        (module, t0, t1, dt) = database[startTime]
        dtotal = dtotal + dt
        print "%*s ! %s ! %s ! %s" % (nameLen, module, t0, t1, dt)
    print "%*s ! %s ! %s ! %s" % (nameLen, 'Total', blank, blank, dtotal)
   
if __name__ == '__main__':
    main()


Exclamation Adding command line options to list specified modules is left as an exercise for the reader.
Back to top
View user's profile Send private message
engelsman



Joined: 21 Aug 2005
Posts: 131
Location: Netherlands

PostPosted: Sun Oct 29, 2006 1:27 pm    Post subject: compile times for my system Reply with quote

According to my script, it would take over 9 hours just to recompile the 347 modules that are currently installed on my system.

After a bit of judicious sorting, and editing, the top ten modules on my system that take the longest to compile are:
Code:

                    Module !     Compile started !     Compile stopped ! Duration
                  kdelibs3 ! 2006-10-28 09:10:44 ! 2006-10-28 10:21:33 ! 1:10:49
                   firefox ! 2006-10-28 10:23:44 ! 2006-10-28 11:12:01 ! 0:48:17
                  kdevelop ! 2006-10-12 16:52:22 ! 2006-10-12 17:23:01 ! 0:30:39
                     glibc ! 2005-11-10 21:49:16 ! 2005-11-10 22:17:03 ! 0:27:47
                      XOrg ! 2006-03-16 21:15:37 ! 2006-03-16 21:42:13 ! 0:26:36
                       qt3 ! 2006-10-28 08:48:06 ! 2006-10-28 09:10:01 ! 0:21:55
                 linux-2.6 ! 2006-10-24 13:46:22 ! 2006-10-24 14:08:03 ! 0:21:41
                       gcc ! 2006-07-21 19:38:49 ! 2006-07-21 19:54:37 ! 0:15:48
                libstdc++5 ! 2005-11-13 15:58:36 ! 2005-11-13 16:11:36 ! 0:13:00
               ImageMagick ! 2006-08-16 18:30:04 ! 2006-08-16 18:38:24 ! 0:08:20
                  <others> !                     !                     !
                     Total !                     !                     ! 9:04:28

Obviously these are the times on my system, so other systems with different processors, memory and other hardware will produce different results.
Back to top
View user's profile Send private message
engelsman



Joined: 21 Aug 2005
Posts: 131
Location: Netherlands

PostPosted: Wed Nov 01, 2006 2:00 pm    Post subject: lvu info $MODULE Reply with quote

The compile time of a module is just one of the things available using lvu info $MODULE, and a similar listing to the one above can be achieved using the much shorter shell script:
Code:

for module in `lvu installed | cut -d: -f1`
do
        took=`lvu info $module | grep "Last compile time:" | sed 's/^ *Last compile time: *//'`
        took=`echo $took | sed 's/m\([0-9]\)s$/m0\1s/' | sed 's/^\([0-9]\)m/0\1m/'`
        echo $module $took
done

which gives the following top ten modules:
Code:

kdelibs3 70m49s
firefox 48m17s
kdevelop 30m39s
glibc 27m47s
XOrg 26m36s
qt3 21m55s
linux-2.6 21m41s
gcc 15m48s
libstdc++5 13m00s
ImageMagick 08m20s

and, as if by magic, the times shown by both scripts are the same, only mine showed the total time and the results were better formatted Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Lunar-Linux Forum Index -> Core Tools All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group