diff options
| author | Richard M. Stallman | 1997-04-21 23:48:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-21 23:48:34 +0000 |
| commit | d83cce6dda49e4ea7b356d4d789cfb78b1d4be65 (patch) | |
| tree | ca46bc9875b910eebde5d07abac6316ad55c2ea5 | |
| parent | 0cbb419463b67b0e992449eeb12f8f2568987b32 (diff) | |
| download | emacs-d83cce6dda49e4ea7b356d4d789cfb78b1d4be65.tar.gz emacs-d83cce6dda49e4ea7b356d4d789cfb78b1d4be65.zip | |
(elp-report-limit): Change prompt string.
(elp-version): Incremented.
| -rw-r--r-- | lisp/emacs-lisp/elp.el | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index f8c06431d70..b694c79707c 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | ;; Author: 1994-1997 Barry A. Warsaw | 5 | ;; Author: 1994-1997 Barry A. Warsaw |
| 6 | ;; Maintainer: tools-help@python.org | 6 | ;; Maintainer: tools-help@python.org |
| 7 | ;; Created: 26-Feb-1994 | 7 | ;; Created: 26-Feb-1994 |
| 8 | ;; Version: 2.39 | 8 | ;; Version: 2.40 |
| 9 | ;; Last Modified: 1997/02/28 18:15:35 | 9 | ;; Last Modified: 1997/04/21 15:48:26 |
| 10 | ;; Keywords: debugging lisp tools | 10 | ;; Keywords: debugging lisp tools |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -76,16 +76,6 @@ | |||
| 76 | ;; elp-restore-function. The other instrument, restore, and reset | 76 | ;; elp-restore-function. The other instrument, restore, and reset |
| 77 | ;; functions are provided for symmetry. | 77 | ;; functions are provided for symmetry. |
| 78 | 78 | ||
| 79 | ;; Note that there are plenty of factors that could make the times | ||
| 80 | ;; reported unreliable, including the accuracy and granularity of your | ||
| 81 | ;; system clock, and the overhead spent in lisp calculating and | ||
| 82 | ;; recording the intervals. The latter I figure is pretty constant | ||
| 83 | ;; so, while the times may not be entirely accurate, I think they'll | ||
| 84 | ;; give you a good feel for the relative amount of work spent in the | ||
| 85 | ;; various lisp routines you are profiling. Note further that times | ||
| 86 | ;; are calculated using wall-clock time, so other system load will | ||
| 87 | ;; affect accuracy too. | ||
| 88 | |||
| 89 | ;; Here is a list of variable you can use to customize elp: | 79 | ;; Here is a list of variable you can use to customize elp: |
| 90 | ;; elp-function-list | 80 | ;; elp-function-list |
| 91 | ;; elp-reset-after-results | 81 | ;; elp-reset-after-results |
| @@ -119,13 +109,13 @@ | |||
| 119 | 109 | ||
| 120 | ;;; Background: | 110 | ;;; Background: |
| 121 | 111 | ||
| 122 | ;; This program is based on the only two existing Emacs Lisp profilers | 112 | ;; This program was inspired by the only two existing Emacs Lisp |
| 123 | ;; that I'm aware of, Boaz Ben-Zvi's profile.el, and Root Boy Jim's | 113 | ;; profilers that I'm aware of, Boaz Ben-Zvi's profile.el, and Root |
| 124 | ;; profiler.el. Both were written for Emacs 18 and both were pretty | 114 | ;; Boy Jim's profiler.el. Both were written for Emacs 18 and both were |
| 125 | ;; good first shots at profiling, but I found that they didn't provide | 115 | ;; pretty good first shots at profiling, but I found that they didn't |
| 126 | ;; the functionality or interface that I wanted. So I wrote this. | 116 | ;; provide the functionality or interface that I wanted, so I wrote |
| 127 | ;; I've tested elp in Emacs 19 and in XEmacs. There's no point in | 117 | ;; this. I've tested elp in XEmacs 19 and Emacs 19. There's no point |
| 128 | ;; even trying to make this work with Emacs 18. | 118 | ;; in even trying to make this work with Emacs 18. |
| 129 | 119 | ||
| 130 | ;; Unlike previous profilers, elp uses Emacs 19's built-in function | 120 | ;; Unlike previous profilers, elp uses Emacs 19's built-in function |
| 131 | ;; current-time to return interval times. This obviates the need for | 121 | ;; current-time to return interval times. This obviates the need for |
| @@ -139,7 +129,7 @@ | |||
| 139 | ;;; Code: | 129 | ;;; Code: |
| 140 | 130 | ||
| 141 | 131 | ||
| 142 | ;; start user configuration variables | 132 | ;; start of user configuration variables |
| 143 | ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | 133 | ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv |
| 144 | 134 | ||
| 145 | (defgroup elp nil | 135 | (defgroup elp nil |
| @@ -181,7 +171,7 @@ If a number, no function that has been called fewer than that number | |||
| 181 | of times will be displayed in the output buffer. If nil, all | 171 | of times will be displayed in the output buffer. If nil, all |
| 182 | functions will be displayed." | 172 | functions will be displayed." |
| 183 | :type '(choice integer | 173 | :type '(choice integer |
| 184 | (const :tag "All" nil)) | 174 | (const :tag "Show All" nil)) |
| 185 | :group 'elp) | 175 | :group 'elp) |
| 186 | 176 | ||
| 187 | (defcustom elp-use-standard-output nil | 177 | (defcustom elp-use-standard-output nil |
| @@ -201,7 +191,7 @@ In other words, a new unique buffer is create every time you run | |||
| 201 | ;; end of user configuration variables | 191 | ;; end of user configuration variables |
| 202 | 192 | ||
| 203 | 193 | ||
| 204 | (defconst elp-version "2.39" | 194 | (defconst elp-version "2.40" |
| 205 | "ELP version number.") | 195 | "ELP version number.") |
| 206 | 196 | ||
| 207 | (defconst elp-help-address "tools-help@python.org" | 197 | (defconst elp-help-address "tools-help@python.org" |
| @@ -223,6 +213,7 @@ This variable is set by the master function.") | |||
| 223 | (defvar elp-master nil | 213 | (defvar elp-master nil |
| 224 | "Master function symbol.") | 214 | "Master function symbol.") |
| 225 | 215 | ||
| 216 | |||
| 226 | ;;;###autoload | 217 | ;;;###autoload |
| 227 | (defun elp-instrument-function (funsym) | 218 | (defun elp-instrument-function (funsym) |
| 228 | "Instrument FUNSYM for profiling. | 219 | "Instrument FUNSYM for profiling. |
| @@ -343,13 +334,16 @@ For example, to instrument all ELP functions, do the following: | |||
| 343 | \\[elp-instrument-package] RET elp- RET" | 334 | \\[elp-instrument-package] RET elp- RET" |
| 344 | (interactive "sPrefix of package to instrument: ") | 335 | (interactive "sPrefix of package to instrument: ") |
| 345 | (elp-instrument-list | 336 | (elp-instrument-list |
| 346 | (mapcar 'intern | 337 | (mapcar |
| 347 | (all-completions prefix obarray | 338 | 'intern |
| 348 | (function | 339 | (all-completions |
| 349 | (lambda (sym) | 340 | prefix obarray |
| 350 | (and (fboundp sym) | 341 | (function |
| 351 | (not (memq (car-safe (symbol-function sym)) | 342 | (lambda (sym) |
| 352 | '(autoload macro)))))))))) | 343 | (and (fboundp sym) |
| 344 | (not (memq (car-safe (symbol-function sym)) '(autoload macro)))) | ||
| 345 | )) | ||
| 346 | )))) | ||
| 353 | 347 | ||
| 354 | (defun elp-restore-list (&optional list) | 348 | (defun elp-restore-list (&optional list) |
| 355 | "Restore the original definitions for all functions in `elp-function-list'. | 349 | "Restore the original definitions for all functions in `elp-function-list'. |
| @@ -609,7 +603,6 @@ displayed." | |||
| 609 | '(elp-report-limit | 603 | '(elp-report-limit |
| 610 | elp-reset-after-results | 604 | elp-reset-after-results |
| 611 | elp-sort-by-function)))) | 605 | elp-sort-by-function)))) |
| 612 | |||
| 613 | 606 | ||
| 614 | (provide 'elp) | 607 | (provide 'elp) |
| 615 | 608 | ||