;ELC   
;;; compiled by rms@psilocin.gnu.ai.mit.edu on Fri Jun 28 05:54:30 1996
;;; from file /home/fsf/rms/e19/lisp/profile.el
;;; emacs version 19.31.3.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (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 (#$ . -473))
#@37 *Name of the profile timer program.
(defvar profile-timer-program (concat exec-directory "profile") (#$ . -558))
#@28 Process running the timer.
(defvar profile-timer-process nil (#$ . 677))
#@63 List of cumulative calls and time for each profiled function.
(defvar profile-time-list nil (#$ . 756))
#@92 List of entry time for each function. 
Both how many times invoked and real time of start.
(defvar profile-init-list nil (#$ . 866))
#@46 Max length of name of any function profiled.
(defvar profile-max-fun-name 0 (#$ . 1005))
#@35 Should NOT be used anywhere else.
(defvar profile-temp-result- nil (#$ . 1100))
#@38 Used to return result from a filter.
(defvar profile-time (byte-code "À‰B‡" [0] 2) (#$ . 1186))
#@25 Name of profile buffer.
(defvar profile-buffer "*profile*" (#$ . 1288))
#@112 Profile all the functions listed in `profile-functions-list'.
With argument FLIST, use the list FLIST instead.
(defalias 'profile-functions #[(&optional flist) "„ 	ÂÃ\"‡" [flist profile-functions-list mapcar profile-a-function] 3 (#$ . 1367) "P"])
#@74 Filter for the timer process.  Sets `profile-time' to the returned time.
(defalias 'profile-filter #[(process input) "ÀÁ\n\"ÃUƒ ÄÅ\"‡È\nÃ‰”O! ˆÈ\nÃ•ÉO!¡‡" [string-match "\\." input 0 error "Bad output from %s" profile-timer-program profile-time string-to-int nil] 5 (#$ . 1625)])
#@45 Print one ENTRY (from `profile-time-list').
(defalias 'profile-print #[(entry) "A@AA‰@\nAÃ\f!¥\\ÆÈÉÊ!ÌQ@	\n@\nA%	ÍUƒ/ Î‚E ÈÏÐ	¥‰!ÐÑ!Z\f_!#±,‡" [entry calls timec float profile-million time 0.0 avgtime format "%-" int-to-string profile-max-fun-name "s%8d%11d.%06d" 0 "\n" "%12d.%06d\n" truncate ftruncate] 9 (#$ . 1918)])
#@101 Display profiling results in the buffer `*profile*'.
(The buffer name comes from `profile-buffer'.)
(defalias 'profile-results #[nil "À	!ˆÂ ˆÃÄÆZÇ\"±ˆÈcˆÄÉ\"Ê±ˆËcˆÌÍ\"‡" [switch-to-buffer profile-buffer erase-buffer "Function" make-string profile-max-fun-name 6 32 " Calls  Total time (sec)  Avg time per call\n" 61 "  " "======  ================  =================\n" mapcar profile-print profile-time-list] 4 (#$ . 2264) nil])
(defalias 'profile-reset-timer #[nil "À	Â\"‡" [process-send-string profile-timer-process "z\n"] 3])
#@44 If ENTRY has non zero time, give an error.
(defalias 'profile-check-zero-init-times #[(entry) "AA‰@ÂU… 	AÂU?… ÃÄ!)‡" [entry time 0 error "Process timer died while making performance profile."] 3 (#$ . 2805)])
#@50 Get time from timer process into `profile-time'.
(defalias 'profile-get-time #[nil "À	!ƒ Â	!Ã=„* ÄÅÆ!#É	Ê\"ˆË	!ˆÌ ˆÍÎ\"ˆÐ	Ñ\"ˆÒ ‡" [processp profile-timer-process process-status run start-process "timer" get-buffer-create profile-buffer profile-timer-program set-process-filter profile-filter process-kill-without-query profile-reset-timer mapcar profile-check-zero-init-times profile-init-list process-send-string "p\n" accept-process-output] 4 (#$ . 3024)])
#@33 Linear search for FUN in FLIST.
(defalias 'profile-find-function #[(fun flist) "… 	@@=ƒ @A‡Â	A\"‡" [flist fun profile-find-function] 3 (#$ . 3498)])
#@47 On entry, keep current time for function FUN.
(defalias 'profile-start-function #[(fun) "À	\n\"‰„ ÄÅ	\"ˆ@ÆU„ ‰@T ‚/ Ç ˆA‰@ ˆA¡)‡" [profile-find-function fun profile-init-list init-time error "Function %s missing from list" 0 1 profile-time] 4 (#$ . 3659)])
(byte-code "ÀÁ\nBÀ‡" [1000000 profile-million current-load-list] 2)
#@66 When the call to the function FUN is finished, add its run time.
(defalias 'profile-update-function #[(fun) "À	\n\"À	\"Ä‰‰‰	‰\nƒ  	„% ËÌ	\"ˆ	@	A\n‰@S ˆ\n@ÍU…¡ 	T ˆ\nA\n@\n@ZA\nAZ\nÍ ˆ\nÍ¡ˆÍY„u \\S@\\ ˆA\\¡ˆAW?…¡ ‰@T ˆ‰AZ¡.‡" [profile-find-function fun profile-init-list profile-time-list nil usec sec time calls accum init-time error "Function %s missing from list" 0 profile-time profile-million] 7 (#$ . 4005)])
(defalias 'profile-convert-byte-code #[(function) "KÂ	!…D Ã	Ä\"ÆA@Ç8È8FC	Ê›ƒ, ËÊ8D	B	Ì8ƒ: Í!	B	Î@	BBM*)‡" [function defn byte-code-function-p append nil contents byte-code 2 3 body 5 interactive 4 documentation lambda] 5])
#@27 Profile the function FUN.
(defalias 'profile-a-function #[(fun) "À	!ˆ	KÂ	!G‰@Å=„ ÆÇ	\"ˆ	È‰‰BBB	B		È‰‰BBB\nB\nWƒ: 	Ì	\f\"M*‡" [profile-convert-byte-code fun symbol-name funlen def lambda error "To profile: %s must be a user-defined function" 0 profile-time-list profile-init-list profile-max-fun-name profile-fix-fun] 5 (#$ . 4732) "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ÊW?…  	@	A@	AA@D;…< 	GÊW?…  ;„J ‚Y ÊC¤Ê	›@<ƒo @Ë=ƒo C¤\fT\f	›‰@Ìš?…  ÍC¤ÎÏDDC¤ÑÒÓC\n¤EC¤ÔC¤ÕÏDDC¤ÒC¤.‡" [nil 2 suffix inter count third second first prefix def 3 interactive (profile-get-time) (profile-get-time) profile-start-function quote fun setq profile-temp-result- progn (profile-get-time) profile-update-function] 8 (#$ . 5109)])
#@54 Restore profiled function FUN to its original state.
(defalias 'profile-restore-fun #[(fun) "@KÁ‰‰A‰A@;ƒ \nA\nA@<ƒ( \nA@@Å=ƒ( \nAÆ\n›@‰<…A A@Ç=…A \nAA@A¡+‡" [fun nil index body def interactive 3 profile-temp-result-] 4 (#$ . 5639)])
#@52 Stop profiling functions.  Clear all the settings.
(defalias 'profile-finish #[nil "ÀÁ\n\"ˆÃÅÅ‰‡" [mapcar profile-restore-fun profile-time-list 0 profile-max-fun-name nil profile-init-list] 3 (#$ . 5889) nil])
#@25 Kill the timer process.
(defalias 'profile-quit #[nil "À	Â\"‡" [process-send-string profile-timer-process "q\n"] 3 (#$ . 6109) nil])
