[gambit-list] --enable-profile

Marc Feeley feeley at iro.umontreal.ca
Wed Jan 11 10:10:13 EST 2006


On 11-Jan-06, at 9:04 AM, Christian wrote:

> At 12:21 Uhr +0100 11.01.2006, Sven.Hartrumpf at FernUni-Hagen.de wrote:
>> P.S.
>> Are there any profiling tools available for use with Gambit besides
>> plain old gprof?
>
> There's statprof from Guillaume Germain, announced on this list on  
> Jan 24 2005. I'm bundling it with chjmodule ( http://scheme.mine.nu/ 
> gambit/chjmodule/ ). As he already says, it's not perfect, it can  
> sometimes be a bit unclear where the time is actually spent when  
> profiling compiled code (for example for recursive calls, or if  
> there are several calculations on one source line - maybe statprof  
> could improve by colouring on a per s-expr basis, but then maybe  
> the collected data isn't good enough, or it's overkill anyway), but  
> it might help.
>
> BTW from what I've read from Brad Lucier's papers, gprof won't help  
> if compiling with single-host, since each module will only show up  
> as one function call in gprof output.
>
> Christian.
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> http://mailman.iro.umontreal.ca/mailman/listinfo/gambit-list

Don't forget --track-scheme and gcov:

$ gsc -track-scheme proftest.scm
$ gcc -fprofile-arcs -ftest-coverage -D___SINGLE_HOST proftest.c  
proftest_.c -lgambc
$ ./a.out
1346269
1346269
1346269
1346269
1346269
1346269
1346269
1346269
1346269
1346269
$ gcov proftest
File 'proftest.c'
Lines executed:100.00% of 10
proftest.c:creating 'proftest.c.gcov'

File 'proftest.scm'
Lines executed:100.00% of 10
proftest.scm:creating 'proftest.scm.gcov'

$ cat proftest.scm.gcov
         -:    0:Source:proftest.scm
         -:    0:Graph:proftest.gcno
         -:    0:Data:proftest.gcda
         -:    0:Runs:1
         -:    0:Programs:1
         -:    1:#! /usr/bin/env gsi-script -:d2
         -:    2:
  26925371:    3:(define (fib n)
  26925370:    4:  (if (< n 2)
  13462690:    5:      1
  26925360:    6:      (+ (fib (- n 1))
  13462680:    7:         (fib (- n 2)))))
         -:    8:
         2:    9:(define (main)
         7:   10:  (let loop ((i 0))
        11:   11:    (if (< i 10)
         -:   12:        (begin
        10:   13:          (pp (fib 30))
        15:   14:          (loop (+ i 1))))))




More information about the Gambit-list mailing list