[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
elp-instrument-file
From: |
Kevin Rodgers |
Subject: |
elp-instrument-file |
Date: |
Thu, 17 Jun 2010 07:13:06 -0600 |
User-agent: |
Thunderbird 2.0.0.24 (Macintosh/20100228) |
elp-instrument-package allows you to profile all the functions whose name begins
with a PACKAGE- prefix. But what if you want to profile all the functions in a
a library, regardless of their name -- for example, the files.el library that is
distributed with Emacs and dumped in the executable.
(defun elp-instrument-file (file)
"Instrument for profiling, all functions defined in FILE.
FILE is a regexp matching a key in the `load-history' alist."
(interactive
(list (concat "\\`"
(regexp-quote (completing-read "File to instrument: "
load-history
nil t))
"\\'")))
(dolist (entry (cdr (load-history-filename-element file)))
(when (and (consp entry)
(eq (car entry) 'defun)
(elp-profilable-p (cdr entry)))
(elp-instrument-function (cdr entry)))))
--
Kevin Rodgers
Denver, Colorado, USA
- elp-instrument-file,
Kevin Rodgers <=