diff options
author | Andy Wingo <wingo@pobox.com> | 2011-05-05 09:59:59 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-05-05 11:43:12 +0200 |
commit | e640b44046dbb5516e691f1b4c6dd3a4cad3ac5b (patch) | |
tree | 12deb4cb9bcf8d83bbb6c6f9bf77d79056e7a91b | |
parent | e6e286bb5895197a9433817fe3998a7c7c525386 (diff) | |
download | guile-e640b44046dbb5516e691f1b4c6dd3a4cad3ac5b.tar.gz |
minor statprof tweaks
* module/statprof.scm (statprof-reset): Make full-stacks? into an
optional arg instead of doing the rest arg dance.
(statprof-display): Format gc-time-taken appropriately.
-rw-r--r-- | module/statprof.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/module/statprof.scm b/module/statprof.scm index da6f3f1fc..9455715fb 100644 --- a/module/statprof.scm +++ b/module/statprof.scm @@ -379,8 +379,8 @@ than @code{statprof-stop}, @code{#f} otherwise." (accumulate-time (get-internal-run-time)) (set! last-start-time #f)))) -(define (statprof-reset sample-seconds sample-microseconds count-calls? - . full-stacks?) +(define* (statprof-reset sample-seconds sample-microseconds count-calls? + #:optional full-stacks?) "Reset the statprof sampler interval to @var{sample-seconds} and @var{sample-microseconds}. If @var{count-calls?} is true, arrange to instrument procedure calls as well as collecting statistical profiling @@ -397,7 +397,7 @@ Enables traps and debugging as necessary." (set! sampling-frequency (cons sample-seconds sample-microseconds)) (set! remaining-prof-time #f) (set! procedure-data (make-hash-table 131)) - (set! record-full-stacks? (and (pair? full-stacks?) (car full-stacks?))) + (set! record-full-stacks? full-stacks?) (set! stacks '()) (sigaction SIGPROF profile-signal-handler) #t) @@ -531,7 +531,7 @@ optional @var{port} argument is passed, uses the current output port." (simple-format #t "Sample count: ~A\n" (statprof-sample-count)) (simple-format #t "Total time: ~A seconds (~A seconds in GC)\n" (statprof-accumulated-time) - (/ gc-time-taken internal-time-units-per-second)))))) + (/ gc-time-taken 1.0 internal-time-units-per-second)))))) (define (statprof-display-anomolies) "A sanity check that attempts to detect anomolies in statprof's |