From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: elp-instrument-file Date: Thu, 17 Jun 2010 07:13:06 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1276780409 4565 80.91.229.12 (17 Jun 2010 13:13:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Jun 2010 13:13:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 17 15:13:28 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OPEuM-0008LL-67 for ged-emacs-devel@m.gmane.org; Thu, 17 Jun 2010 15:13:26 +0200 Original-Received: from localhost ([127.0.0.1]:60459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPEuL-0008Ky-EO for ged-emacs-devel@m.gmane.org; Thu, 17 Jun 2010 09:13:25 -0400 Original-Received: from [140.186.70.92] (port=58954 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPEuD-0008Hk-AH for emacs-devel@gnu.org; Thu, 17 Jun 2010 09:13:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPEuC-0001hn-8z for emacs-devel@gnu.org; Thu, 17 Jun 2010 09:13:17 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:53468) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPEuC-0001hQ-3f for emacs-devel@gnu.org; Thu, 17 Jun 2010 09:13:16 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OPEu9-0008IH-N8 for emacs-devel@gnu.org; Thu, 17 Jun 2010 15:13:13 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jun 2010 15:13:13 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jun 2010 15:13:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 23 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126077 Archived-At: 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