9b6480080f38

Add profiling modes
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 24 Dec 2018 01:51:06 -0500
parents 6b2d21a74a45
children 72093637ac8b
branches/tags (none)
files src/debugging.lisp

Changes

--- a/src/debugging.lisp	Sun Dec 16 18:26:55 2018 -0500
+++ b/src/debugging.lisp	Mon Dec 24 01:51:06 2018 -0500
@@ -192,12 +192,12 @@
   (dump-profile filename))
 
 #+sbcl
-(defmacro profile (&body body)
-  "Profile `body` and dump the report to `lisp.prof`."
+(defmacro profile (form &key (mode :cpu))
+  "Profile `form` and dump the report to `lisp.prof`."
   `(progn
-     (start-profiling)
+     (start-profiling :mode ,mode)
      (unwind-protect
-         (time (progn ,@body))
+         (time ,form)
        (stop-profiling))))