diff options
author | Andy Wingo <wingo@pobox.com> | 2009-12-21 00:08:18 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-12-21 00:08:18 +0100 |
commit | a6dc56a71e0085f9e0f889ecbb8b085f6c92da7b (patch) | |
tree | e292d87128032416396adf9dac292a17728033be | |
parent | 500f6a47e2609f936d43f47bcce4e429eb57997d (diff) | |
download | guile-a6dc56a71e0085f9e0f889ecbb8b085f6c92da7b.tar.gz |
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.
-rw-r--r-- | module/system/repl/command.scm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm index 0b1434c2d..3e6e7793b 100644 --- a/module/system/repl/command.scm +++ b/module/system/repl/command.scm @@ -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)))) + ;;; |