X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/3f715d17fef56ee78a3df7ebb00d4e8b1aec37de..5f8d2ce0f8529ca565cd679fb0fbb2a34ebef0a1:/lisp/emacs-lisp/elp.el diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index 53eeea144c..f1e70c5a57 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -1,7 +1,7 @@ ;;; elp.el --- Emacs Lisp Profiler ;; Copyright (C) 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Barry A. Warsaw ;; Maintainer: FSF @@ -133,19 +133,19 @@ :group 'lisp) (defcustom elp-function-list nil - "*List of functions to profile. + "List of functions to profile. Used by the command `elp-instrument-list'." :type '(repeat function) :group 'elp) (defcustom elp-reset-after-results t - "*Non-nil means reset all profiling info after results are displayed. + "Non-nil means reset all profiling info after results are displayed. Results are displayed with the `elp-results' command." :type 'boolean :group 'elp) (defcustom elp-sort-by-function 'elp-sort-by-total-time - "*Non-nil specifies ELP results sorting function. + "Non-nil specifies ELP results sorting function. These functions are currently available: elp-sort-by-call-count -- sort by the highest call count @@ -162,7 +162,7 @@ the symbol's name string." :group 'elp) (defcustom elp-report-limit 1 - "*Prevent some functions from being displayed in the results buffer. + "Prevent some functions from being displayed in the results buffer. If a number, no function that has been called fewer than that number of times will be displayed in the output buffer. If nil, all functions will be displayed." @@ -171,12 +171,12 @@ functions will be displayed." :group 'elp) (defcustom elp-use-standard-output nil - "*If non-nil, output to `standard-output' instead of a buffer." + "If non-nil, output to `standard-output' instead of a buffer." :type 'boolean :group 'elp) (defcustom elp-recycle-buffers-p t - "*If nil, don't recycle the `elp-results-buffer'. + "If nil, don't recycle the `elp-results-buffer'. In other words, a new unique buffer is create every time you run \\[elp-results]." :type 'boolean @@ -210,7 +210,10 @@ This variable is set by the master function.") ;; (delq nil (mapcar (lambda (x) (and (symbolp x) (fboundp x) x)) ;; (aref (symbol-function 'elp-wrapper) 2))) ;; to help me find this list. - error call-interactively apply current-time) + error call-interactively apply current-time + ;; Andreas Politz reports problems profiling these (Bug#4233): + + byte-code-function-p functionp byte-code subrp + indirect-function fboundp) "List of functions that cannot be profiled. Those functions are used internally by the profiling code and profiling them would thus lead to infinite recursion.") @@ -266,7 +269,7 @@ FUNSYM must be a symbol of a defined function." (setq newguts (append newguts `((elp-wrapper (quote ,funsym) ,(when (commandp funsym) - '(called-interactively-p)) + '(called-interactively-p 'any)) args)))) ;; to record profiling times, we set the symbol's function ;; definition so that it runs the elp-wrapper function with the @@ -340,9 +343,12 @@ Argument FUNSYM is the symbol of a defined function." ;;;###autoload (defun elp-instrument-list (&optional list) - "Instrument for profiling, all functions in `elp-function-list'. -Use optional LIST if provided instead." + "Instrument, for profiling, all functions in `elp-function-list'. +Use optional LIST if provided instead. +If called interactively, read LIST using the minibuffer." (interactive "PList of functions to instrument: ") + (unless (listp list) + (signal 'wrong-type-argument (list 'listp list))) (let ((list (or list elp-function-list))) (mapcar 'elp-instrument-function list))) @@ -534,6 +540,7 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." (defvar elp-results-symname-map (let ((map (make-sparse-keymap))) (define-key map [mouse-2] 'elp-results-jump-to-definition) + (define-key map [follow-link] 'mouse-face) (define-key map "\C-m" 'elp-results-jump-to-definition) map) "Keymap used on the function name column." ) @@ -550,6 +557,7 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." 'elp-symname (intern symname) 'keymap elp-results-symname-map 'mouse-face 'highlight + 'face 'link 'help-echo "mouse-2 or RET jumps to definition"))) ;;;###autoload