summaryrefslogtreecommitdiff
path: root/module/statprof.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2014-02-25 22:46:32 +0100
committerAndy Wingo <wingo@pobox.com>2014-02-25 22:46:32 +0100
commitfd953d7a1065572ee7aa64ee1592f66e85dea892 (patch)
treed0aaac296166f77110111debdd0edf27290e5413 /module/statprof.scm
parent19bf8caff31c9797b698cb41feab291415c24e06 (diff)
downloadguile-fd953d7a1065572ee7aa64ee1592f66e85dea892.tar.gz
gcprof tweaks
* module/statprof.scm (gcprof): No need to reset in gcprof; the fresh profiler state and the parameterize handle that. Fix mistaken set-vm-trace-level! as well.
Diffstat (limited to 'module/statprof.scm')
-rw-r--r--module/statprof.scm16
1 files changed, 1 insertions, 15 deletions
diff --git a/module/statprof.scm b/module/statprof.scm
index 2268af3b7..c9deb033f 100644
--- a/module/statprof.scm
+++ b/module/statprof.scm
@@ -728,20 +728,8 @@ If @var{full-stacks?} is true, at each sample, statprof will store away the
whole call tree, for later analysis. Use @code{statprof-fetch-stacks} or
@code{statprof-fetch-call-tree} to retrieve the last-stored stacks."
- (let ((state (fresh-profiler-state)))
+ (let ((state (fresh-profiler-state #:full-stacks? full-stacks?)))
(parameterize ((profiler-state state))
-
- (define (reset)
- (when (positive? (profile-level state))
- (error "Can't reset profiler while profiler is running."))
- (set-accumulated-time! state 0)
- (set-last-start-time! state #f)
- (set-sample-count! state 0)
- (set-count-calls?! state #f)
- (set-procedure-data! state (make-hash-table 131))
- (set-record-full-stacks?! state full-stacks?)
- (set-stacks! state '()))
-
(define (gc-callback)
(cond
((inside-profiler? state))
@@ -768,7 +756,6 @@ whole call tree, for later analysis. Use @code{statprof-fetch-stacks} or
(set-last-start-time! state (get-internal-run-time))
(set-gc-time-taken! state (assq-ref (gc-stats) 'gc-time-taken))
(add-hook! after-gc-hook gc-callback)
- (set-vm-trace-level! (1+ (vm-trace-level)))
#t))
(define (stop)
@@ -783,7 +770,6 @@ whole call tree, for later analysis. Use @code{statprof-fetch-stacks} or
(dynamic-wind
(lambda ()
- (reset)
(start))
(lambda ()
(let lp ((i loop))