Profiler still up to date?
Hello! I'm currently trying to use Guillaume Germain's profiler (http://www.iro.umontreal.ca/~germaing/statprof.html) to well, em, profile my program ;). But I am encoutering severall problems... The exemple that comes with Guillaume's profile works just fine on my machine, but when I try to use it with my own code, it doesn't work... I have something like: include "statprof.scm") (profile-start!) (load "opengl") (load "glu") (load "glut") (load "Question2") (load "Question2-ui") (profile-stop!) (write-profile-report "profile-report") where the main execution occurs in Question2-ui. When I compile all this, i.e. compiles opengl, glu, glut, Question2 and Question2-ui to .o1 files and then compile my profile.scm file to c -> native code, well the program runs fine, but when I stop it, I get: *** ERROR IN write-profile-report -- Wrong number of arguments passed to procedure (max) With a little investigation, I found out that statprof's *bucket* variable is still empty when the profiling has ended... :( Guillaume's code that should fill the *buckets* looks like: (define (profile-heartbeat!) (##continuation-capture (lambda (cont) (##thread-heartbeat!) (let ((id (identify-continuation cont))) (pp id) (if (not (eq? id 'unknown)) (let ((bucket (assoc (car id) *buckets*))) (set! *total* (+ *total* 1)) (if (not bucket) (begin (set! *buckets* (cons (cons (car id) ;; fixme: arbitrary hard limit ;; on the length of source ;; files (make-vector 5000 0)) *buckets*)) (set! bucket (car *buckets*)))) (vector-set! (cdr bucket) (cadr id) (+ (vector-ref (cdr bucket) (cadr id)) 1)))))))) As you can see, I've added a (pp id) to see what happens, and I only get some unknown printed in the console... So how come code doesn't get recognized in the profiler?? Thank you! ^_^ David
Afficher les réponses par date
On 29-Feb-08, at 2:10 PM, David St-Hilaire wrote:
where the main execution occurs in Question2-ui. When I compile all this, i.e. compiles opengl, glu, glut, Question2 and Question2-ui to .o1 files and then compile my profile.scm file to c -> native code, well the program runs fine, but when I stop it, I get:
*** ERROR IN write-profile-report -- Wrong number of arguments passed to procedure (max)
You need to compile the program with the -debug-source option, so that the .o1 files contain source location information. Marc
participants (2)
-
David St-Hilaire -
Marc Feeley