[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elp-instrument-file
From: |
Dan Nicolaescu |
Subject: |
Re: elp-instrument-file |
Date: |
Wed, 30 Jun 2010 21:19:34 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Kevin Rodgers <address@hidden> writes:
> 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.
FWIW, IMHO this is a good idea. Please also add a menu binding in
emacs-lisp-mode when this gets installed. [What is it waiting for?]
It would also be nice to have a similar function for trace.el
>
> (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