mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
statprof uses new setitimer magical usecs ability
* module/statprof.scm (sample-stack-procs): Take advantage of setitimer allowing usecs >= 1e6.
This commit is contained in:
parent
966d4bdd70
commit
e68ed8397d
1 changed files with 3 additions and 5 deletions
|
@ -295,11 +295,9 @@
|
||||||
hit-count-call?))
|
hit-count-call?))
|
||||||
|
|
||||||
(define (reset-sigprof-timer usecs)
|
(define (reset-sigprof-timer usecs)
|
||||||
(let ((secs (quotient usecs #e1e6))
|
;; Guile's setitimer binding is terrible.
|
||||||
(usecs (remainder usecs #e1e6)))
|
(let ((prev (setitimer ITIMER_PROF 0 0 0 usecs)))
|
||||||
;; Guile's setitimer binding is terrible.
|
(+ (* (caadr prev) #e1e6) (cdadr prev))))
|
||||||
(let ((prev (setitimer ITIMER_PROF 0 0 secs usecs)))
|
|
||||||
(+ (* (caadr prev) #e1e6) (cdadr prev)))))
|
|
||||||
|
|
||||||
(define (profile-signal-handler sig)
|
(define (profile-signal-handler sig)
|
||||||
(define state (existing-profiler-state))
|
(define state (existing-profiler-state))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue