Commit ce56157e authored by Tomohiro Matsuyama's avatar Tomohiro Matsuyama
Browse files

* profiler.el (with-sample-profiling): New macro.

(with-memory-profiling): New macro.
parent a4924b14
......@@ -2,6 +2,8 @@
* profiler.el: Switch to cl-lib.
(profiler-start): Change mode spec.
(with-sample-profiling): New macro.
(with-memory-profiling): New macro.
2012-08-22 Daiki Ueno <>
......@@ -575,17 +575,23 @@ otherwise collapse the entry."
(defun profiler-report ()
(defun sample-profiler-report ()
(let ((sample-log (sample-profiler-log)))
(when sample-log
(profiler-log-fixup sample-log)
(profiler-report-log sample-log)))
(profiler-report-log sample-log))))
(defun memory-profiler-report ()
(let ((memory-log (memory-profiler-log)))
(when memory-log
(profiler-log-fixup memory-log)
(profiler-report-log memory-log))))
(defun profiler-report ()
(defun profiler-find-log (filename)
......@@ -596,5 +602,29 @@ otherwise collapse the entry."
(let ((log (read (current-buffer))))
(profiler-report-log log))))
;;; Profiling helpers
(cl-defmacro with-sample-profiling ((&key (interval profiler-sample-interval)) &rest body)
(sample-profiler-start ,interval)
(progn ,@body)
(cl-defmacro with-memory-profiling (() &rest body)
(progn ,@body)
(provide 'profiler)
;;; profiler.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment