mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
Minor updates for Scheme runtime (statprof, backtraces)
* module/system/vm/frame.scm: Add a comment about a case that we need to handle in the future. * module/statprof.scm (statprof-proc-call-data): Always use the program code as the key, even for primitives.
This commit is contained in:
parent
455015d8e9
commit
d145b57baf
2 changed files with 6 additions and 6 deletions
|
@ -503,11 +503,7 @@ none is available."
|
||||||
(error "Can't call statprof-proc-call-data while profiler is running."))
|
(error "Can't call statprof-proc-call-data while profiler is running."))
|
||||||
(unless (program? proc)
|
(unless (program? proc)
|
||||||
(error "statprof-call-data only works for VM programs"))
|
(error "statprof-call-data only works for VM programs"))
|
||||||
(let* ((code (program-code proc))
|
(hashv-ref (stack-samples->procedure-data state) (program-code proc)))
|
||||||
(key (if (primitive-code? code)
|
|
||||||
(procedure-name proc)
|
|
||||||
code)))
|
|
||||||
(hashv-ref (stack-samples->procedure-data state) key)))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Stats
|
;; Stats
|
||||||
|
|
|
@ -339,7 +339,7 @@
|
||||||
;;; Pretty printing
|
;;; Pretty printing
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
;; Basically there are two cases to deal with here:
|
;; Basically there are three cases to deal with here:
|
||||||
;;
|
;;
|
||||||
;; 1. We've already parsed the arguments, and bound them to local
|
;; 1. We've already parsed the arguments, and bound them to local
|
||||||
;; variables. In a standard (lambda (a b c) ...) call, this doesn't
|
;; variables. In a standard (lambda (a b c) ...) call, this doesn't
|
||||||
|
@ -353,6 +353,10 @@
|
||||||
;; number of arguments, or perhaps we're doing a typed dispatch and
|
;; number of arguments, or perhaps we're doing a typed dispatch and
|
||||||
;; the types don't match. In that case the arguments are all on the
|
;; the types don't match. In that case the arguments are all on the
|
||||||
;; stack, and nothing else is on the stack.
|
;; stack, and nothing else is on the stack.
|
||||||
|
;;
|
||||||
|
;; 3. Alternately it's possible that we're between a primitive call
|
||||||
|
;; and its associated return. In that case, we won't be able to
|
||||||
|
;; say anything at all.
|
||||||
|
|
||||||
(define* (frame-call-representation frame #:key top-frame?)
|
(define* (frame-call-representation frame #:key top-frame?)
|
||||||
(let* ((ip (frame-instruction-pointer frame))
|
(let* ((ip (frame-instruction-pointer frame))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue