1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

poor man's statprof integration with the repl: ,pr

* module/system/repl/command.scm (profile): Add a very poor integration
  of statprof with the repl.
This commit is contained in:
Andy Wingo 2009-12-21 00:08:18 +01:00
parent 500f6a47e2
commit a6dc56a71e

View file

@ -36,6 +36,7 @@
#:use-module (ice-9 documentation)
#:use-module (ice-9 and-let-star)
#:use-module (ice-9 rdelim)
#:use-module (statprof)
#:export (meta-command))
@ -359,13 +360,14 @@ Time execution."
(get identity gc-start gc-end))
result))
(define-meta-command (profile repl form . opts)
(define-meta-command (profile repl (form) . opts)
"profile FORM
Profile execution."
(apply vm-profile
(repl-vm repl)
(repl-compile repl (repl-parse repl form))
opts))
;; FIXME opts
(let ((vm (repl-vm repl))
(proc (make-program (repl-compile repl (repl-parse repl form)))))
(with-statprof #:hz 100 (vm proc))))
;;;