mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +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:
parent
500f6a47e2
commit
a6dc56a71e
1 changed files with 7 additions and 5 deletions
|
@ -36,6 +36,7 @@
|
||||||
#:use-module (ice-9 documentation)
|
#:use-module (ice-9 documentation)
|
||||||
#:use-module (ice-9 and-let-star)
|
#:use-module (ice-9 and-let-star)
|
||||||
#:use-module (ice-9 rdelim)
|
#:use-module (ice-9 rdelim)
|
||||||
|
#:use-module (statprof)
|
||||||
#:export (meta-command))
|
#:export (meta-command))
|
||||||
|
|
||||||
|
|
||||||
|
@ -359,13 +360,14 @@ Time execution."
|
||||||
(get identity gc-start gc-end))
|
(get identity gc-start gc-end))
|
||||||
result))
|
result))
|
||||||
|
|
||||||
(define-meta-command (profile repl form . opts)
|
(define-meta-command (profile repl (form) . opts)
|
||||||
"profile FORM
|
"profile FORM
|
||||||
Profile execution."
|
Profile execution."
|
||||||
(apply vm-profile
|
;; FIXME opts
|
||||||
(repl-vm repl)
|
(let ((vm (repl-vm repl))
|
||||||
(repl-compile repl (repl-parse repl form))
|
(proc (make-program (repl-compile repl (repl-parse repl form)))))
|
||||||
opts))
|
(with-statprof #:hz 100 (vm proc))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue