Pass profile into run-with-stack-sampling.
authorJoe Marshall <eval.apply@gmail.com>
Sat, 21 Jan 2012 20:02:10 +0000 (12:02 -0800)
committerJoe Marshall <eval.apply@gmail.com>
Sat, 21 Jan 2012 20:02:10 +0000 (12:02 -0800)
src/runtime/stack-sample.scm

index c38fc1f52afb43f84de169989b551328fe880703..bd9370d548b7dfb78f2039989fe0d8bc9391268a 100644 (file)
 \f
 ;;;; Running with Stack Sampling
 
-(define (run-with-stack-sampling sample-interval thunk)
-  (let ((profile (make-profile))
-        (timer-registration #t))
+(define (run-with-stack-sampling profile sample-interval thunk)
+  (let ((timer-registration #t))
     (define (register-event)
       (if timer-registration
           (set! timer-registration
       (with-notification (lambda (output-port)
                            (write-string "Stack-sampling" output-port))
         (lambda ()
-          (run-with-stack-sampling sample-interval thunk)))
+          (run-with-stack-sampling (make-profile) sample-interval thunk)))
     (write-notification-line
      (lambda (output-port)
        (display-profile profile output-port)))