;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:12 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/emacs-lisp/elp.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 "`elp.el' was compiled for Emacs 19.29 or later"))

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


(custom-declare-group 'elp nil "Emacs Lisp Profiler" :group 'lisp)
#@75 *List of functions to profile.
Used by the command `elp-instrument-list'.
(custom-declare-variable 'elp-function-list 'nil '(#$ . -686) :type '(repeat function) :group 'elp)
#@124 *Non-nil means reset all profiling info after results are displayed.
Results are displayed with the `elp-results' command.
(custom-declare-variable 'elp-reset-after-results 't '(#$ . -867) :type 'boolean :group 'elp)
#@641 *Non-nil specifies elp results sorting function.
These functions are currently available:

  elp-sort-by-call-count   -- sort by the highest call count
  elp-sort-by-total-time   -- sort by the highest total time
  elp-sort-by-average-time -- sort by the highest average times

You can write you're own sort function. It should adhere to the
interface specified by the PRED argument for the `sort' defun.  Each
"element of LIST" is really a 4 element vector where element 0 is
the call count, element 1 is the total time spent in the function,
element 2 is the average time spent in the function, and element 3 is
the symbol's name string.
(custom-declare-variable 'elp-sort-by-function ''elp-sort-by-total-time '(#$ . -1091) :type 'function :group 'elp)
#@230 *Prevents 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.
(custom-declare-variable 'elp-report-limit '1 '(#$ . -1853) :type '(choice integer (const :tag "Show All" nil)) :group 'elp)
#@67 *Non-nil says to output to `standard-output' instead of a buffer.
(custom-declare-variable 'elp-use-standard-output 'nil '(#$ . -2213) :type 'boolean :group 'elp)
#@133 *Nil says to not recycle the `elp-results-buffer'.
In other words, a new unique buffer is create every time you run
\[elp-results].
(custom-declare-variable 'elp-recycle-buffers-p 't '(#$ . -2383) :type 'boolean :group 'elp)
#@47 Buffer name for outputting profiling results.
(defvar elp-results-buffer "*ELP Profiling Results*" (#$ . 2614))
#@32 ELP information property name.
(defconst elp-timer-info-property 'elp-info (#$ . 2732))
#@53 List of all functions currently being instrumented.
(defvar elp-all-instrumented-list nil (#$ . 2826))
#@101 Controls whether functions should record times or not.
This variable is set by the master function.
(defvar elp-record-p t (#$ . 2936))
#@25 Master function symbol.
(defvar elp-master nil (#$ . 3078))
#@81 Instrument FUNSYM for profiling.
FUNSYM must be a symbol of a defined function.
(defalias 'elp-instrument-function #[(funsym) "\306!\210K\307\310\211	#\311	\242\312=\203 \313\314\"\210	\242\315=\203' \313\316\"\210\317!\2032 \320\321\"\320\322\323D\324\325\317!??E\326FC\"\327\f\n#\210\330N\211\203f \327\330\331#\210M\210\327\330#\210\202j M\210)>\206y B\211+\207" [funsym funguts infovec newguts elp-timer-info-property advice-info elp-restore-function vector 0 (lambda (&rest args)) macro error "ELP cannot profile macro: %s" autoload "ELP cannot profile autoloaded function: %s" commandp append ((interactive)) elp-wrapper quote and (interactive-p) args put ad-advice-info nil elp-all-instrumented-list] 9 (#$ . 3144) "aFunction to instrument: "])
#@115 Restore an instrumented function to its original definition.
Argument FUNSYM is the symbol of a defined function.
(defalias 'elp-restore-function #[(funsym) "	N\306\"\f=\203 \307\310\311	\307#\210\n\2057 \312!\2057 \313K!?\2057 \314K\236\2057 \n\315HM)\207" [funsym elp-timer-info-property info elp-all-instrumented-list elp-master elp-record-p delq nil t put functionp byte-code-function-p elp-wrapper 2] 4 (#$ . 3936) "aFunction to restore: "])
#@104 Instrument for profiling, all functions in `elp-function-list'.
Use optional LIST if provided instead.
(defalias 'elp-instrument-list #[(&optional list) "\206 	\302\303\")\207" [list elp-function-list mapcar elp-instrument-function] 3 (#$ . 4404) "PList of functions to instrument: "])
#@174 Instrument for profiling, all functions which start with PREFIX.
For example, to instrument all ELP functions, do the following:

    \[elp-instrument-package] RET elp- RET
(defalias 'elp-instrument-package #[(prefix) "\302G!\203 \303\304!\210\305\306\307\310	\311#\"!\207" [prefix obarray zerop error "Instrumenting all Emacs functions would render Emacs unusable" elp-instrument-list mapcar intern all-completions #[(sym) "\301!\205\f K\242\302>?\207" [sym fboundp (autoload macro)] 2]] 7 (#$ . 4701) "sPrefix of package to instrument: "])
#@115 Restore the original definitions for all functions in `elp-function-list'.
Use optional LIST if provided instead.
(defalias 'elp-restore-list #[(&optional list) "\206 	\302\303\")\207" [list elp-function-list mapcar elp-restore-function] 3 (#$ . 5255) "PList of functions to restore: "])
#@68 Restores the original definitions of all functions being profiled.
(defalias 'elp-restore-all #[nil "\301!\207" [elp-all-instrumented-list elp-restore-list] 2 (#$ . 5553) nil])
#@45 Reset the profiling information for FUNSYM.
(defalias 'elp-reset-function #[(funsym) "	N\211\204 \303\304\"\210\n\305\211I\210\n\306\307I)\207" [funsym elp-timer-info-property info error "%s is not instrumented for profiling" 0 1 0.0] 4 (#$ . 5737) "aFunction to reset: "])
#@114 Reset the profiling information for all functions in `elp-function-list'.
Use optional LIST if provided instead.
(defalias 'elp-reset-list #[(&optional list) "\206 	\302\303\")\207" [list elp-function-list mapcar elp-reset-function] 3 (#$ . 6022) "PList of functions to reset: "])
#@67 Reset the profiling information for all functions being profiled.
(defalias 'elp-reset-all #[nil "\301!\207" [elp-all-instrumented-list elp-reset-list] 2 (#$ . 6313) nil])
#@40 Set the master function for profiling.
(defalias 'elp-set-master #[(funsym) "\304>\206 \305!\207" [funsym elp-master elp-record-p elp-all-instrumented-list nil elp-instrument-function] 2 (#$ . 6492) "aMaster function: "])
#@29 Unsets the master function.
(defalias 'elp-unset-master #[nil "\302\303\211\207" [elp-master elp-record-p nil t] 2 (#$ . 6727) nil])
(defalias 'elp-elapsed-time #[(start end) "@	@Z\302_A@	A@Z\\AA@	AA@Z\303\245\\\207" [end start 65536.0 1000000.0] 3])
(put 'elp-elapsed-time 'byte-optimizer 'byte-compile-inline-expand)
#@199 This function has been instrumented for profiling by the ELP.
ELP is the Emacs Lisp Profiler.  To restore the function to its
original definition, use \[elp-restore-function] or \[elp-restore-all].
(defalias 'elp-wrapper #[(funsym interactive-p args) "\203\f 	=\203\f \306	N\211\307H\310\204  \311\312	\"\210\n\2049 \203/ \313!\2024 \314\"\202\236 \310\211\f\315\f\315HTI\210\203\\ \316 \313!\316 \202k \316 \314\"\316 \f\317\f\317H@@Z\320_A@A@Z\\AA@AA@Z\321\245\\*\\I\210*\203\252 	=\203\252 \310+\207" [elp-master funsym elp-record-p elp-timer-info-property info func t 2 nil error "%s is not instrumented for profiling" call-interactively apply 0 current-time 1 65536.0 1000000.0 result interactive-p args exit-time enter-time end start] 7 (#$ . 7058)])
(byte-code "\301B\305\301!\204\f \306\302B\305\302!\204 \306\303B\305\303!\204$ \306\304B\305\304!\2040 \306\306\207" [current-load-list elp-field-len elp-cc-len elp-at-len elp-et-len boundp nil] 2)
(defalias 'elp-sort-by-call-count #[(vec1 vec2) "\302H	\302HY\207" [vec1 vec2 0] 3])
(defalias 'elp-sort-by-total-time #[(vec1 vec2) "\302H	\302HY\207" [vec1 vec2 1] 3])
(defalias 'elp-sort-by-average-time #[(vec1 vec2) "\302H	\302HY\207" [vec1 vec2 2] 3])
(defalias 'elp-pack-number #[(number width) "G	X\203	 \207\302\303\"\203+ \304\224\304\225O\305	\306\225Z\306\224[Z\307ZO\310\306\224\306\225OQ\207\305	O\260\207" [number width string-match "^\\(.*\\)\\(e[+-].*\\)$" 1 0 2 3 "..."] 5])
(put 'elp-pack-number 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'elp-output-result #[(resultvec) "\306H\307H\310H\311H\312\312\312\313	!\313\n!\313!\2055 \247\2055 	W?\205\376 \fc\210\314\315\fG[\\\310\\\"\210c\210\314\315G[\\\310\\\"\210\211GX\203l \202\234 \316\317\"\203\224 \307\224\307\225O\306\310\225Z\310\224[Z\311ZO\320\310\224\310\225OQ\202\234 \306O\260*\211GX\203\262 \202\342 \316\317\"\203\332 \307\224\307\225O\306\310\225Z\310\224[Z\311ZO\320\310\224\310\225OQ\202\342 \306O\260*\211c\210\314\315G[\\\310\\\"\210c\210*\321c.\207" [resultvec cc tt at symname callcnt 0 1 2 3 nil number-to-string insert-char 32 string-match "^\\(.*\\)\\(e[+-].*\\)$" "..." "\n" totaltime avetime elp-report-limit elp-field-len elp-cc-len elp-et-len width number elp-at-len atstr ttstr] 7])
#@182 Display current profiling results.
If `elp-reset-after-results' is non-nil, then current profiling
information for all instrumented functions are reset after results are
displayed.
(defalias 'elp-results #[nil "p\203 \306	!\202 \307	!\nq\210\310 \210\311 \210\312\313\313G\211\314\314G\315\315G \316!\316G\"\317\320#\"$c\210\fV\203U \321\322\fZ\"\210\f\323\323\323!\324\261\210\321\325\"\210\323c\210\321\325\"\210\323c\210\321\325 \"\210\323c\210\321\325\"\"\210\324c\210%\203\223 \326$%\"$\317\327$\"\210.q\210\330\n!\210&\204\254 '\203\262 \331ed{!\210(\205\271 \332 *\207" [elp-recycle-buffers-p elp-results-buffer resultsbuf curbuf longest title get-buffer-create generate-new-buffer erase-buffer beginning-of-buffer 0 "Function Name" "Call Count" "Elapsed Time" "Average Time" mapcar #[(funsym) "	N\306\307\"\n\310H\n\311H\n\204 \312\261\2029 G]\313\f\314\f!\2030 \315\2027 \316!\316\f!\245$,\207" [funsym elp-timer-info-property info symname cc tt format "%s" 0 1 "No profiling information found for: " vector zerop 0.0 float longest] 6] insert-char 32 "  " "\n" 61 sort elp-output-result pop-to-buffer princ elp-reset-all titlelen elp-field-len cc-header elp-cc-len et-header elp-et-len at-header elp-at-len elp-all-instrumented-list resvec elp-sort-by-function elp-use-standard-output noninteractive elp-reset-after-results] 8 (#$ . 9493) nil])
(defalias 'elp-unload-hook #[nil "\300 \207" [elp-restore-all] 1])
(provide 'elp)
