;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:49:04 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/obsolete/profile.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`profile.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@32 *List of functions to profile.
(defvar profile-functions-list nil (#$ . -625))
#@25 Name of profile buffer.
(defvar profile-buffer "*profile*" (#$ . 710))
#@274 If non-nil, each time slice gets credited to at most one function.
(Namely, the most recent one in the call stack.)  If nil, then the
time reported for a function includes the entire time from beginning
to end, even if it called some other function that was also profiled.
(defvar profile-distinct nil (#$ . 788))
#@112 List of cumulative calls and time for each profiled function.
Each element looks like (FUN NCALLS SEC . USEC).
(defvar profile-time-list nil (#$ . 1109))
#@289 List of entry time for each function.
Both how many times invoked and real time of start.
Each element looks like (FUN DEPTH HISEC LOSEC USEC), where DEPTH is
the current recursion depth, and HISEC, LOSEC, and USEC represent the
starting time of the call (or of the outermost recursion).
(defvar profile-init-list nil (#$ . 1270))
#@46 Max length of name of any function profiled.
(defvar profile-max-fun-name 0 (#$ . 1607))
#@99 A list of the profiled functions currently executing.
Used only when profile-distinct is non-nil.
(defvar profile-call-stack nil (#$ . 1702))
#@87 The start time of the current time slice.
Used only when profile-distinct is non-nil.
(defvar profile-last-time nil (#$ . 1850))
(byte-code "\301B\302\301\207" [current-load-list profile-million 1000000] 2)
#@112 Profile all the functions listed in `profile-functions-list'.
With argument FLIST, use the list FLIST instead.
(defalias 'profile-functions #[(&optional flist) "\302\303\206 	\"\207" [flist profile-functions-list mapcar profile-a-function] 3 (#$ . 2067) "P"])
#@45 Print one ENTRY (from `profile-time-list').
(defalias 'profile-print #[(entry) "A@AA\306	!?\205 \n@\nA\307!\245\\	\245\310\311\312!\313Q@	\n@\nA%\f\2042 \314\2026 \310\315\f\"\261+\207" [entry calls timec profile-million avgtime profile-max-fun-name zerop float format "%-" int-to-string "s %7d %10d.%06d" "\n" " %18.6f\n"] 6 (#$ . 2335)])
#@101 Display profiling results in the buffer `*profile*'.
(The buffer name comes from `profile-buffer'.)
(defalias 'profile-results #[nil "\303!\210\304 \210\305\306	\307Z\310\"\261\210\311c\210\306	\312\"\313\261\210\314c\210\315\316\n\"\207" [profile-buffer profile-max-fun-name profile-time-list switch-to-buffer erase-buffer "Function" make-string 6 32 " Calls  Total time (sec)  Avg time per call\n" 61 "  " "======  ================  =================\n" mapcar profile-print] 4 (#$ . 2692) nil])
#@173 Add to DEST the difference between timestamps NOW and PREV.
DEST is a pair (SEC . USEC) which is modified in place.
NOW and PREV are triples as returned by `current-time'.
(defalias 'profile-add-time #[(dest now prev) "@	@\n@Z\306_\\	\211A@)\n\211A@)Z\\A	\211AA)@\n\211AA)@Z\\\f\307W\203= S\f\\\202L \fY\203L T\fZ\240\210\f\241*\207" [dest now prev x usec sec 65536 0 profile-million] 5 (#$ . 3200)])
#@47 Mark the beginning of a call to function FUN.
(defalias 'profile-function-prolog #[(fun) "\203 \306 \n\203 \307\n@\236AA	\f#\210\nB	\211)\207\306 \f\236A\2043 \310\311\"\210\312@!\204D \211@T\240\202M \313\240\210	\241*\207" [profile-distinct profile-time profile-call-stack profile-time-list profile-last-time fun current-time profile-add-time error "Function %s missing from list" zerop 1 profile-init-list init-time] 4 (#$ . 3630)])
#@41 Mark the end of a call to function FUN.
(defalias 'profile-function-epilog #[(fun) "\203# \306 	\n\236A\211@T\240\210\307A\f#\210A\f\211*\207\306 	\f\236A	\n\236A\203; \204@ \310\311	\"\210\211@S\240\210\312@!\205] \211@T\240\210\307A\fA#+\207" [profile-distinct fun profile-time-list accum profile-time profile-last-time current-time profile-add-time error "Function %s missing from list" zerop profile-call-stack profile-init-list init-time] 4 (#$ . 4096)])
(defalias 'profile-convert-byte-code #[(function) "K\304	!\205> \305	\306\"\307\nA@\310\n8\311\n8FC\312\n\233\203) \313\312\n8DB\314\n8\2035 \315!B\316\n@BBM*)\207" [function defn contents body byte-code-function-p append nil byte-code 2 3 5 interactive 4 documentation lambda] 5])
#@27 Profile the function FUN.
(defalias 'profile-a-function #[(fun) "K\211\242\306=\203 \307	A@!\210K\310	!\210)\311!\210K\312!G\211@\313=\2040 \314\315\"\210\316\211\211BBBB\316\317BB\fB\nW\203J \n\320	\"M*\207" [fun def funlen profile-time-list profile-init-list profile-max-fun-name autoload load fetch-bytecode profile-convert-byte-code symbol-name lambda error "To profile: %s must be a user-defined function" 0 nil profile-fix-fun] 5 (#$ . 4882) "aFunction to profile: "])
#@84 Take function FUN and return it fixed for profiling.
DEF is (symbol-function FUN).
(defalias 'profile-fix-fun #[(fun def) "G\304W\203	 \207@A@DAA	@;\203( 	A\203( \n	@C\244	A	@<\203? 	@@\305=\203? \n	@C\244	A	@\242\306=\203K \202] \n\306\307DD\310\311	B\312\307DDED\244*\207" [def suffix prefix fun 3 interactive profile-function-prolog quote unwind-protect progn profile-function-epilog] 7 (#$ . 5383)])
#@54 Restore profiled function FUN to its original state.
(defalias 'profile-restore-fun #[(fun) "K\304\211\211\243\211A@;\203 	A	A@\242\305=\203  	A	A@\242\306=\2052 	\211AA@A@A\241+\207" [fun index body def nil interactive profile-function-prolog] 4 (#$ . 5807)])
#@52 Stop profiling functions.  Clear all the settings.
(defalias 'profile-finish #[nil "\203 \303@@!\210A\211\204 \304\305\211\207" [profile-time-list profile-max-fun-name profile-init-list profile-restore-fun 0 nil] 3 (#$ . 6082) nil])
(provide 'profile)
