summaryrefslogtreecommitdiff
path: root/module/statprof.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2014-02-22 17:02:53 +0100
committerAndy Wingo <wingo@pobox.com>2014-02-22 17:02:53 +0100
commit546efe25144b1d17400a432162288e0961dbbb89 (patch)
tree7727a3cbb3024f85dd8788b485ef79c8c830aca9 /module/statprof.scm
parent3476a3692e52748f207ec55ef7624d85a70f0f6a (diff)
downloadguile-546efe25144b1d17400a432162288e0961dbbb89.tar.gz
simplify profile-signal-handler
* module/statprof.scm (profile-signal-handler): Don't bother detecting if we were in a count-call call or not; it doesn't matter, and we should accumulate time in any case.
Diffstat (limited to 'module/statprof.scm')
-rw-r--r--module/statprof.scm27
1 files changed, 7 insertions, 20 deletions
diff --git a/module/statprof.scm b/module/statprof.scm
index 84321a301..6cc98570a 100644
--- a/module/statprof.scm
+++ b/module/statprof.scm
@@ -310,29 +310,16 @@
;; tail-calls eval. perhaps we should always compile the
;; signal handler instead...
(stack (or (make-stack #t profile-signal-handler)
- (pk 'what! (make-stack #t))))
- (inside-apply-trap? (sample-stack-procs state stack)))
-
- (unless inside-apply-trap?
- ;; disabling here is just a little more efficient, but
- ;; not necessary given inside-profiler?. We can't just
- ;; disable unconditionally at the top of this function
- ;; and eliminate inside-profiler? because it seems to
- ;; confuse guile wrt re-enabling the trap when
- ;; count-call finishes.
- (when (count-calls? state)
- (set-vm-trace-level! (1- (vm-trace-level))))
- (accumulate-time state stop-time))
-
+ (pk 'what! (make-stack #t)))))
+
+ (sample-stack-procs state stack)
+ (accumulate-time state stop-time)
+ (set-last-start-time! state (get-internal-run-time))
+
(setitimer ITIMER_PROF
0 0
(car (sampling-frequency state))
- (cdr (sampling-frequency state)))
-
- (unless inside-apply-trap?
- (set-last-start-time! state (get-internal-run-time))
- (when (count-calls? state)
- (set-vm-trace-level! (1+ (vm-trace-level)))))))
+ (cdr (sampling-frequency state)))))
(set-inside-profiler?! state #f))