annotate lisp/utils/elp.el @ 82:6a378aca36af r20-0b91

Import from CVS: tag r20-0b91
author cvs
date Mon, 13 Aug 2007 09:07:36 +0200
parents b82b59fe008d
children cca96a509cfe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; elp.el --- Emacs Lisp Profiler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
5 ;; Author: 1994-1996 Barry A. Warsaw
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
6 ;; Maintainer: tools-help@python.org
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Created: 26-Feb-1994
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
8 ;; Version: 2.37
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
9 ;; Last Modified: 1996/10/23 04:06:58
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; Keywords: debugging lisp tools
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; If you want to profile a bunch of functions, set elp-function-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; to the list of symbols, then do a M-x elp-instrument-list. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; hacks those functions so that profiling information is recorded
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; whenever they are called. To print out the current results, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; M-x elp-results. If you want output to go to standard-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; instead of a separate buffer, setq elp-use-standard-output to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; non-nil. With elp-reset-after-results set to non-nil, profiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; information will be reset whenever the results are displayed. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; can also reset all profiling info at any time with M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; elp-reset-all.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; You can also instrument all functions in a package, provided that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; the package follows the GNU coding standard of a common textural
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; prefix. Use M-x elp-instrument-package for this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; If you want to sort the results, set elp-sort-by-function to some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; predicate function. The three most obvious choices are predefined:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; elp-sort-by-call-count, elp-sort-by-average-time, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; elp-sort-by-total-time. Also, you can prune from the output, all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; functions that have been called fewer than a given number of times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; by setting elp-report-limit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; Elp can instrument byte-compiled functions just as easily as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; interpreted functions, but it cannot instrument macros. However,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; when you redefine a function (e.g. with eval-defun), you'll need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; re-instrument it with M-x elp-instrument-function. This will also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; reset profiling information for that function. Elp can handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; interactive functions (i.e. commands), but of course any time spent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; idling for user prompts will show up in the timing results.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;; You can also designate a `master' function. Profiling times will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; be gathered for instrumented functions only during execution of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; this master function. Thus, if you have some defuns like:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;; (defun foo () (do-something-time-intensive))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; (defun bar () (foo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; (defun baz () (bar) (foo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; and you want to find out the amount of time spent in bar and foo,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; but only during execution of bar, make bar the master. The call of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; foo from baz will not add to foo's total timing sums. Use M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; elp-set-master and M-x elp-unset-master to utilize this feature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; Only one master function can be set at a time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; You can restore any function's original function definition with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;; elp-restore-function. The other instrument, restore, and reset
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; functions are provided for symmetry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;; Here is a list of variable you can use to customize elp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;; elp-function-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; elp-reset-after-results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;; elp-sort-by-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;; elp-report-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; Here is a list of the interactive commands you can use:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ;; elp-instrument-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; elp-restore-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; elp-instrument-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; elp-restore-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; elp-instrument-package
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;; elp-restore-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;; elp-reset-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; elp-reset-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; elp-reset-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;; elp-set-master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;; elp-unset-master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; elp-results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; elp-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;; Note that there are plenty of factors that could make the times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;; reported unreliable, including the accuracy and granularity of your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;; system clock, and the overhead spent in lisp calculating and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; recording the intervals. I figure the latter is pretty constant,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;; so while the times may not be entirely accurate, I think they'll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;; give you a good feel for the relative amount of work spent in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;; various lisp routines you are profiling. Note further that times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; are calculated using wall-clock time, so other system load will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ;; affect accuracy too. You cannot profile anything longer than ~18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; hours since I throw away the most significant 16 bits of seconds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; returned by current-time: 2^16 == 65536 seconds == ~1092 minutes ==
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;; ~18 hours. I doubt you will ever want to profile stuff on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ;; order of 18 hours anyway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;;; Background:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;; This program was inspired by the only two existing Emacs Lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; profilers that I'm aware of, Boaz Ben-Zvi's profile.el, and Root
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ;; Boy Jim's profiler.el. Both were written for Emacs 18 and both were
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ;; pretty good first shots at profiling, but I found that they didn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;; provide the functionality or interface that I wanted, so I wrote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; this. I've tested elp in XEmacs 19 and Emacs 19. There's no point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; in even trying to make this work with Emacs 18.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; Unlike previous profilers, elp uses Emacs 19's built-in function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; current-time to return interval times. This obviates the need for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;; both an external C program and Emacs processes to communicate with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;; such a program, and thus simplifies the package as a whole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; TBD:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;; Make this act like a real profiler, so that it records time spent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;; in all branches of execution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;; start of user configuration variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defvar elp-function-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 "*List of functions to profile.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 Used by the command `elp-instrument-list'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (defvar elp-reset-after-results t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "*Non-nil means reset all profiling info after results are displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Results are displayed with the `elp-results' command.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (defvar elp-sort-by-function 'elp-sort-by-total-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 "*Non-nil specifies elp results sorting function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 These functions are currently available:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 elp-sort-by-call-count -- sort by the highest call count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 elp-sort-by-total-time -- sort by the highest total time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 elp-sort-by-average-time -- sort by the highest average times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 You can write you're own sort function. It should adhere to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 interface specified by the PRED argument for the `sort' defun. Each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 \"element of LIST\" is really a 4 element vector where element 0 is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 the call count, element 1 is the total time spent in the function,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 element 2 is the average time spent in the function, and element 3 is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 the symbol's name string.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (defvar elp-report-limit 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "*Prevents some functions from being displayed in the results buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 If a number, no function that has been called fewer than that number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 of times will be displayed in the output buffer. If nil, all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 functions will be displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (defvar elp-use-standard-output nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 "*Non-nil says to output to `standard-output' instead of a buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (defvar elp-recycle-buffers-p t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 "*Nil says to not recycle the `elp-results-buffer'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 In other words, a new unique buffer is create every time you run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 \\[elp-results].")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ;; end of user configuration variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
180 (defconst elp-version "2.37"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "ELP version number.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
183 (defconst elp-help-address "tools-help@python.org"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 "Address accepting submissions of bug reports and questions.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (defvar elp-results-buffer "*ELP Profiling Results*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "Buffer name for outputting profiling results.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (defconst elp-timer-info-property 'elp-info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "ELP information property name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (defvar elp-all-instrumented-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 "List of all functions currently being instrumented.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defvar elp-record-p t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 "Controls whether functions should record times or not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 This variable is set by the master function.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defvar elp-master nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "Master function symbol.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (defun elp-instrument-function (funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 "Instrument FUNSYM for profiling.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 FUNSYM must be a symbol of a defined function."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (interactive "aFunction to instrument: ")
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
208 ;; restore the function. this is necessary to avoid infinite
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
209 ;; recursion of already instrumented functions (i.e. elp-wrapper
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
210 ;; calling elp-wrapper ad infinitum). it is better to simply
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
211 ;; restore the function than to throw an error. this will work
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
212 ;; properly in the face of eval-defun because if the function was
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
213 ;; redefined, only the timer info will be nil'd out since
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
214 ;; elp-restore-function is smart enough not to trash the new
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
215 ;; definition.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
216 (elp-restore-function funsym)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (let* ((funguts (symbol-function funsym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (infovec (vector 0 0 funguts))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (newguts '(lambda (&rest args))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;; we cannot profile macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (and (eq (car-safe funguts) 'macro)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
222 (error "ELP cannot profile macro: %s" funsym))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
223 ;; TBD: at some point it might be better to load the autoloaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
224 ;; function instead of throwing an error. if we do this, then we
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
225 ;; probably want elp-instrument-package to be updated with the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
226 ;; newly loaded list of functions. i'm not sure it's smart to do
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
227 ;; the autoload here, since that could have side effects, and
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
228 ;; elp-instrument-function is similar (in my mind) to defun-ish
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
229 ;; type functionality (i.e. it shouldn't execute the function).
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
230 (and (eq (car-safe funguts) 'autoload)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
231 (error "ELP cannot profile autoloaded function: %s" funsym))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;; put rest of newguts together
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (if (commandp funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (setq newguts (append newguts '((interactive)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (setq newguts (append newguts (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (list 'elp-wrapper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (list 'quote funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (list 'and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 '(interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (not (not (commandp funsym))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 'args))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; to record profiling times, we set the symbol's function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;; definition so that it runs the elp-wrapper function with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; function symbol as an argument. We place the old function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ;; definition on the info vector.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;; The info vector data structure is a 3 element vector. The 0th
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;; element is the call-count, i.e. the total number of times this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;; function has been entered. This value is bumped up on entry to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;; the function so that non-local exists are still recorded. TBD:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ;; I haven't tested non-local exits at all, so no guarantees.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 ;; The 1st element is the total amount of time in usecs that have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ;; been spent inside this function. This number is added to on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ;; function exit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;; The 2nd element is the old function definition list. This gets
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ;; funcall'd in between start/end time retrievals. I believe that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ;; this lets us profile even byte-compiled functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;; put the info vector on the property list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (put funsym elp-timer-info-property infovec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; set the symbol's new profiling function definition to run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;; elp-wrapper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (fset funsym newguts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ;; add this function to the instrumentation list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (or (memq funsym elp-all-instrumented-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (setq elp-all-instrumented-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (cons funsym elp-all-instrumented-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (defun elp-restore-function (funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 "Restore an instrumented function to its original definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 Argument FUNSYM is the symbol of a defined function."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (interactive "aFunction to restore: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (let ((info (get funsym elp-timer-info-property)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ;; delete the function from the all instrumented list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (setq elp-all-instrumented-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (delq funsym elp-all-instrumented-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ;; if the function was the master, reset the master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (if (eq funsym elp-master)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (setq elp-master nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 elp-record-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;; zap the properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (put funsym elp-timer-info-property nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ;; restore the original function definition, but if the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 ;; wasn't instrumented do nothing. we do this after the above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;; because its possible the function got un-instrumented due to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;; circumstances beyond our control. Also, check to make sure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ;; that the current function symbol points to elp-wrapper. If
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
297 ;; not, then the user probably did an eval-defun, or loaded a
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
298 ;; byte-compiled version, while the function was instrumented and
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
299 ;; we don't want to destroy the new definition. can it ever be
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
300 ;; the case that a lisp function can be compiled instrumented?
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (and info
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
302 (not (compiled-function-p (symbol-function funsym)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (assq 'elp-wrapper (symbol-function funsym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (fset funsym (aref info 2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (defun elp-instrument-list (&optional list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 "Instrument for profiling, all functions in `elp-function-list'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 Use optional LIST if provided instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (interactive "PList of functions to instrument: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (let ((list (or list elp-function-list)))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
312 (mapcar 'elp-instrument-function list)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (defun elp-instrument-package (prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 "Instrument for profiling, all functions which start with PREFIX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 For example, to instrument all ELP functions, do the following:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 \\[elp-instrument-package] RET elp- RET"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (interactive "sPrefix of package to instrument: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (elp-instrument-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (mapcar 'intern (all-completions prefix obarray
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (lambda (sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (and (fboundp sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (not (eq (car-safe
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (symbol-function sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 'macro)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (defun elp-restore-list (&optional list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 "Restore the original definitions for all functions in `elp-function-list'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 Use optional LIST if provided instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (interactive "PList of functions to restore: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (let ((list (or list elp-function-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (mapcar 'elp-restore-function list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (defun elp-restore-all ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 "Restores the original definitions of all functions being profiled."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (elp-restore-list elp-all-instrumented-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (defun elp-reset-function (funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 "Reset the profiling information for FUNSYM."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (interactive "aFunction to reset: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (let ((info (get funsym elp-timer-info-property)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (or info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (error "%s is not instrumented for profiling." funsym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (aset info 0 0) ;reset call counter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (aset info 1 0.0) ;reset total time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 ;; don't muck with aref 2 as that is the old symbol definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (defun elp-reset-list (&optional list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 "Reset the profiling information for all functions in `elp-function-list'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 Use optional LIST if provided instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (interactive "PList of functions to reset: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (let ((list (or list elp-function-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (mapcar 'elp-reset-function list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (defun elp-reset-all ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 "Reset the profiling information for all functions being profiled."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (elp-reset-list elp-all-instrumented-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (defun elp-set-master (funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 "Set the master function for profiling."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (interactive "aMaster function: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 ;; when there's a master function, recording is turned off by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 ;; default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (setq elp-master funsym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 elp-record-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ;; make sure master function is instrumented
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (or (memq funsym elp-all-instrumented-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (elp-instrument-function funsym)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (defun elp-unset-master ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 "Unsets the master function."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 ;; when there's no master function, recording is turned on by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (setq elp-master nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 elp-record-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (defsubst elp-get-time ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 ;; get current time in seconds and microseconds. I throw away the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 ;; most significant 16 bits of seconds since I doubt we'll ever want
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 ;; to profile lisp on the order of 18 hours. See notes at top of file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (let ((now (current-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (+ (float (nth 1 now)) (/ (float (nth 2 now)) 1000000.0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (defun elp-wrapper (funsym interactive-p args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 "This function has been instrumented for profiling by the ELP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 ELP is the Emacs Lisp Profiler. To restore the function to its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 original definition, use \\[elp-restore-function] or \\[elp-restore-all]."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 ;; turn on recording if this is the master function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (if (and elp-master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (eq funsym elp-master))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (setq elp-record-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 ;; get info vector and original function symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (let* ((info (get funsym elp-timer-info-property))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (func (aref info 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (or func
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (error "%s is not instrumented for profiling." funsym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (if (not elp-record-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 ;; when not recording, just call the original function symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 ;; and return the results.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (setq result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (if interactive-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (call-interactively func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (apply func args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 ;; we are recording times
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (let ((enter-time (elp-get-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ;; increment the call-counter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (aset info 0 (1+ (aref info 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ;; now call the old symbol function, checking to see if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 ;; should be called interactively. make sure we return the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 ;; correct value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (setq result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (if interactive-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (call-interactively func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (apply func args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ;; calculate total time in function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (aset info 1 (+ (aref info 1) (- (elp-get-time) enter-time)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ;; turn off recording if this is the master function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (if (and elp-master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (eq funsym elp-master))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (setq elp-record-p nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 ;; shut the byte-compiler up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (defvar elp-field-len nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (defvar elp-cc-len nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (defvar elp-at-len nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (defvar elp-et-len nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (defun elp-sort-by-call-count (vec1 vec2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 ;; sort by highest call count. See `sort'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (>= (aref vec1 0) (aref vec2 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (defun elp-sort-by-total-time (vec1 vec2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 ;; sort by highest total time spent in function. See `sort'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (>= (aref vec1 1) (aref vec2 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (defun elp-sort-by-average-time (vec1 vec2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 ;; sort by highest average time spent in function. See `sort'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (>= (aref vec1 2) (aref vec2 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (defsubst elp-pack-number (number width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 ;; pack the NUMBER string into WIDTH characters, watching out for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 ;; very small or large numbers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (if (<= (length number) width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 ;; check for very large or small numbers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (if (string-match "^\\(.*\\)\\(e[+-].*\\)$" number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (concat (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (substring number (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (- width (match-end 2) (- (match-beginning 2)) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 "..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (substring number (match-beginning 2) (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (concat (substring number 0 width)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (defun elp-output-result (resultvec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ;; output the RESULTVEC into the results buffer. RESULTVEC is a 4 or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 ;; more element vector where aref 0 is the call count, aref 1 is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ;; total time spent in the function, aref 2 is the average time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; spent in the function, and aref 3 is the symbol's string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 ;; name. All other elements in the vector are ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (let* ((cc (aref resultvec 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (tt (aref resultvec 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (at (aref resultvec 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (symname (aref resultvec 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 callcnt totaltime avetime)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (setq callcnt (number-to-string cc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 totaltime (number-to-string tt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 avetime (number-to-string at))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 ;; possibly prune the results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (if (and elp-report-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (numberp elp-report-limit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (< cc elp-report-limit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (insert symname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (insert-char 32 (+ elp-field-len (- (length symname)) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ;; print stuff out, formatting it nicely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (insert callcnt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (insert-char 32 (+ elp-cc-len (- (length callcnt)) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (let ((ttstr (elp-pack-number totaltime elp-et-len))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (atstr (elp-pack-number avetime elp-at-len)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (insert ttstr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (insert-char 32 (+ elp-et-len (- (length ttstr)) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (insert atstr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (insert "\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (defun elp-results ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 "Display current profiling results.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 If `elp-reset-after-results' is non-nil, then current profiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 information for all instrumented functions are reset after results are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 displayed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (let ((curbuf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (resultsbuf (if elp-recycle-buffers-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (get-buffer-create elp-results-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (generate-new-buffer elp-results-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (set-buffer resultsbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (beginning-of-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ;; get the length of the longest function name being profiled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (let* ((longest 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (title "Function Name")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (titlelen (length title))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (elp-field-len titlelen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (cc-header "Call Count")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (elp-cc-len (length cc-header))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (et-header "Elapsed Time")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (elp-et-len (length et-header))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (at-header "Average Time")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (elp-at-len (length at-header))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (resvec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (lambda (funsym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (let* ((info (get funsym elp-timer-info-property))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (symname (format "%s" funsym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (cc (aref info 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (tt (aref info 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (if (not info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (insert "No profiling information found for: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 symname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (setq longest (max longest (length symname)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (vector cc tt (if (zerop cc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 0.0 ;avoid arithmetic div-by-zero errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (/ (float tt) (float cc)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 symname)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 elp-all-instrumented-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 ) ; end let*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (insert title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (if (> longest titlelen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (insert-char 32 (- longest titlelen))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (setq elp-field-len longest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (insert " " cc-header " " et-header " " at-header "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (insert-char ?= elp-field-len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (insert-char ?= elp-cc-len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (insert-char ?= elp-et-len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (insert-char ?= elp-at-len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 ;; if sorting is enabled, then sort the results list. in either
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 ;; case, call elp-output-result to output the result in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 ;; buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (if elp-sort-by-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (setq resvec (sort resvec elp-sort-by-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (mapcar 'elp-output-result resvec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 ;; now pop up results buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (set-buffer curbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (pop-to-buffer resultsbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ;; copy results to standard-output?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (if (or elp-use-standard-output noninteractive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (princ (buffer-substring (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 ;; reset profiling info if desired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (and elp-reset-after-results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (elp-reset-all))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (eval-when-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (require 'reporter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (defun elp-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 "Submit via mail, a bug report on elp."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (y-or-n-p "Do you want to submit a report on elp? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 elp-help-address (concat "elp " elp-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 '(elp-report-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 elp-reset-after-results
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 elp-sort-by-function))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (provide 'elp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 ;; elp.el ends here