‡Æ
õMö9c       s[    d  Z  
 & d k Z ' d k Z ( d k Z ) d k Z ; d „  Z G d „  Z S d f  d „  ƒ  YZ Äd e f d „  ƒ  YZ ýd e f d	 „  ƒ  YZ	 (d
 „  Z
 -e d j oŸ .d k Z /d k Z 0e i d o 1d GH2e i d ƒ n 4e i d Z 6e i d =9e i i d e i i e ƒ ƒ ;e d e d ƒ n d S(   s    Class for profiling Python code.Nc    sw   ; < t  ƒ  } = y > | i |  ƒ } Wn ? t j
 o
 @ n XA | o B | i | d ƒ n D | i ƒ  Sd  S(   Ni    (   s   Profiles   profs   runs	   statements
   SystemExits   argss
   dump_statss   print_stats(   s	   statements   argss   profs$   /mit/python/lib/python2.0/profile.pys   run; s   
c     s˜   G H x‹ t  i d H rl }  I t i i |  d ƒ } J t i i | ƒ o8 K t i d | ƒ } L | o L d G| GHn M Pn q WO d GP d GHd  S(   Ni    s   profile.docs   ${PAGER-more} s   *** Pager exit status:s-   Sorry, can't find the help file "profile.doc"s   along the Python search path(	   s   syss   paths   dirnames   oss   joins   fullnames   existss   systems   sts(   s   dirnames   fullnames   stss$   /mit/python/lib/python2.0/profile.pys   helpG s    	
 s   Profilec      s]  S d  Z  w y e d „ Z ¡ d „  Z § d „  Z ¬ d „  Z ½ d „  Z Ç d „  Z Ò d „  Z Ü d „  Z	 ã d	 „  Z
 î d
 „  Z d „  Z d f  d „  ƒ  YZ d f  d „  ƒ  YZ $d „  Z 1d „  Z ;d „  Z @d „  Z Fd „  Z Jd „  Z Xd „  Z ]d „  Z gd „  Z ›d „  Z ³d „  Z ¸d „  Z ½d „  Z RS(   s	  Profiler class.
	
	self.cur is always a tuple.  Each such tuple corresponds to a stack
	frame that is currently active (self.cur[-2]).  The following are the
	definitions of its members.  We use this external "parallel stack" to
	avoid contaminating the program that we are profiling. (old profiler
	used to write into the frames local dictionary!!) Derived classes
	can change the definition of some entries, as long as they leave
	[-2:] intact.

	[ 0] = Time that needs to be charged to the parent frame's function.
	       It is used so that a function call will not have to access the
	       timing data for the parent frame.
	[ 1] = Total time spent in this frame's function, excluding time in
	       subfunctions
	[ 2] = Cumulative time spent in this frame's function, including time in
	       all subfunctions to this frame.
	[-3] = Name of the function that corresponds to this frame.  
	[-2] = Actual frame that we correspond to (used to sync exception handling)
	[-1] = Our parent 6-tuple (corresponds to frame.f_back)

	Timing data for each function is stored as a 5-tuple in the dictionary
	self.timings[].  The index is always the name stored in self.cur[4].
	The following are the definitions of the members:

	[0] = The number of times this function was called, not counting direct
	      or indirect recursion,
	[1] = Number of times this function appears on the stack, minus one
	[2] = Total time spent internal to this function
	[3] = Cumulative time that this function was present on the stack.  In
	      non-recursive functions, this is the total execution time from start
	      to finish of each invocation of a function, including time spent in
	      all subfunctions.
	[5] = A dictionary indicating for each function name, the number of times
	      it was called by us.
	c    sæ  y z h  |  _ { t |  _ | d |  _ ~ h  |  i d <|  i d <|  i d <|  _ „ | oÜ … t
 i d j o= † d  k } ‡ | i |  _	 ˆ |  i |  _ ‰ |  i |  _ n‰ Š t t d ƒ o" ‹ t i |  _	 Œ |  i |  _ nT  t t
 d ƒ o" Ž t
 i |  _	  |  i |  _ n ‘ t i |  _	 ’ |  i |  _ nƒ ” | |  _	 • |  i	 ƒ  } – y< — t | ƒ d j o ˜ |  i |  _ n š |  i |  _ Wn% › t j
 o œ |  i |  _ n X |  i ƒ  |  _ ž |  i d	 ƒ d  S(
   Ns    s   calls   returns	   exceptions   macs   clocks   timesi   s   profiler(   s   selfs   timingss   Nones   curs   cmds   trace_dispatch_calls   trace_dispatch_returns   trace_dispatch_exceptions   dispatchs   timers   oss   names   MacOSs   GetTickss   trace_dispatch_macs
   dispatchers   get_time_macs   get_times   hasattrs   times   clocks   trace_dispatch_is   timess   trace_dispatchs   ts   lens   trace_dispatch_ls	   TypeErrors   simulate_call(   s   selfs   timers   MacOSs   ts$   /mit/python/lib/python2.0/profile.pys   __init__y s8   0c    sn   ¡ ¢ |  i ƒ  } £ t | ƒ t f  ƒ j p t | ƒ t g  ƒ j o ¤ t d „  | d ƒ } n ¥ | Sd  S(   Nc    s   ¤ |  | S(   N(   s   xs   y(   s   xs   ys$   /mit/python/lib/python2.0/profile.pys   <lambda>¤ s    i    (   s   selfs   timers   ts   types   reduce(   s   selfs   ts$   /mit/python/lib/python2.0/profile.pys   get_time¡ s   5c    s   § ¨ |  i ƒ  d Sd  S(   Nf60.0(   s   selfs   timer(   s   selfs$   /mit/python/lib/python2.0/profile.pys   get_time_mac§ s   c    s©   ¬ ­ |  i ƒ  } ® | d | d |  i } ± |  i | | | ƒ o+ ² |  i ƒ  } ³ | d | d |  _ n, µ |  i ƒ  } ¶ | d | d | |  _ · d  Sd  S(   Ni    i   (   s   selfs   timers   ts   dispatchs   events   frames   r(   s   selfs   frames   events   args   ts   rs$   /mit/python/lib/python2.0/profile.pys   trace_dispatch¬ s   c    sj   ½ ¾ |  i ƒ  |  i } ¿ |  i | | | ƒ o À |  i ƒ  |  _ n Â |  i ƒ  | |  _ Ã d  Sd  S(   N(   s   selfs   timers   ts   dispatchs   events   frame(   s   selfs   frames   events   args   ts$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_i½ s
   c    sv   Ç È |  i ƒ  d |  i } É |  i | | | ƒ o Ê |  i ƒ  d |  _ n Ì |  i ƒ  d | |  _ Í d  Sd  S(   Nf60.0(   s   selfs   timers   ts   dispatchs   events   frame(   s   selfs   frames   events   args   ts$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_macÇ s
   c    sj   Ò Ó |  i ƒ  |  i } Õ |  i | | | ƒ o Ö |  i ƒ  |  _ n Ø |  i ƒ  | |  _ Ù d  Sd  S(   N(   s   selfs   get_times   ts   dispatchs   events   frame(   s   selfs   frames   events   args   ts$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_lÒ s
   c 	   s[   Ü Ý |  i \ } } } } } } Þ | | j o | o ß |  i	 | | ƒ Sn à d Sd  S(   Ni    (   s   selfs   curs   rts   rtts   rcts   rfns   rframes   rcurs   frames   trace_dispatch_returns   t(	   s   selfs   frames   ts   rts   rtts   rcts   rfns   rframes   rcurs$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_exceptionÜ s   c 
   sÑ   ã ä | i } å | i | i | i f } æ | d d | | |  i	 f |  _	 ç |  i
 i | ƒ oF è |  i
 | \ } } } } }	 é | | d | | |	 f |  i
 | <n  ë d d d d h  f |  i
 | <ì d Sd  S(   Ni    i   (   s   frames   f_codes   fcodes   co_filenames   co_firstlinenos   co_names   fns   ts   selfs   curs   timingss   has_keys   ccs   nss   tts   cts   callers(
   s   selfs   frames   ts   fcodes   fns   ccs   nss   tts   cts   callerss$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_callã s   !'c    s/  î ô |  i \ } } } } } } õ | | } ö | | } ø | \ }	 }
 } } } } ù |	 |
 | | | | | | f |  _ û |  i | \ } } } } } ü | o ý | | } þ | d } n ÿ | i | ƒ o  | | d | | <n d | | <| | d | | | | f |  i | <d Sd  S(   Ni   (   s   selfs   curs   rts   rtts   rcts   rfns   frames   rcurs   ts   sfts   pts   ptts   pcts   pfns   pframes   pcurs   timingss   ccs   nss   tts   cts   callerss   has_key(   s   selfs   frames   ts   rts   rtts   rcts   rfns   rcurs   sfts   pts   ptts   pcts   pfns   pframes   pcurs   ccs   nss   tts   cts   callerss$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_returnî s   &'c    s@   |  i d o d  Sn | |  _ |  i | ƒ d  S(   Ni   (   s   selfs   curs   cmds   simulate_call(   s   selfs   cmds$   /mit/python/lib/python2.0/profile.pys   set_cmds    s	   fake_codec      s   d „  Z  d „  Z RS(   Nc    s7   | |  _ | |  _ | |  _ d |  _ d  S(   Ni    (   s   filenames   selfs   co_filenames   lines   co_lines   names   co_names   co_firstlineno(   s   selfs   filenames   lines   names$   /mit/python/lib/python2.0/profile.pys   __init__s   c    s&   t  |  i |  i |  i f ƒ Sd  S(   N(   s   reprs   selfs   co_filenames   co_lines   co_name(   s   selfs$   /mit/python/lib/python2.0/profile.pys   __repr__s   (   s   __init__s   __repr__(    s$   /mit/python/lib/python2.0/profile.pys	   fake_codes   s
   fake_framec      s    d „  Z  RS(   Nc    s    !| |  _ "| |  _ d  S(   N(   s   codes   selfs   f_codes   priors   f_back(   s   selfs   codes   priors$   /mit/python/lib/python2.0/profile.pys   __init__ s   (   s   __init__(    s$   /mit/python/lib/python2.0/profile.pys
   fake_frames   c    s   $%|  i d d | ƒ } &|  i o '|  i d } n
 )t } *|  i | | ƒ } +|  i	 d | d ƒ } ,d  Sd  S(   Ns   profilei    i   s   call(   s   selfs	   fake_codes   names   codes   curs   pframes   Nones
   fake_frames   frames   dispatchs   a(   s   selfs   names   codes   pframes   frames   as$   /mit/python/lib/python2.0/profile.pys   simulate_call$s   	c    sz   12|  i ƒ  |  i } 3xA 3|  i d o. 6|  i d |  i d | ƒ } 7d } q W8|  i ƒ  | |  _ d  S(   Ni   s   returni   i    (   s   selfs   get_times   ts   curs   dispatchs   a(   s   selfs   ts   as$   /mit/python/lib/python2.0/profile.pys   simulate_cmd_complete1s    !c    s9   ;<d  k  } =| i |  ƒ i ƒ  i d ƒ i ƒ  d  S(   Ni   (   s   pstatss   Statss   selfs
   strip_dirss
   sort_statss   print_stats(   s   selfs   pstatss$   /mit/python/lib/python2.0/profile.pys   print_stats;s   c    sI   @At  | d ƒ } B|  i ƒ  Ct i |  i | ƒ D| i ƒ  d  S(   Ns   wb(	   s   opens   files   fs   selfs   create_statss   marshals   dumps   statss   close(   s   selfs   files   fs$   /mit/python/lib/python2.0/profile.pys
   dump_stats@s   c    s!   FG|  i ƒ  H|  i ƒ  d  S(   N(   s   selfs   simulate_cmd_completes   snapshot_stats(   s   selfs$   /mit/python/lib/python2.0/profile.pys   create_statsFs   c 	   s»   JKh  |  _ Lx¢ |  i i ƒ  d LrŒ } M|  i | \ } } } } } N| i
 ƒ  } Od } Px* | i ƒ  d Pr } Q| | | } qv WR| | | | | f |  i | <q$ Wd  S(   Ni    (   s   selfs   statss   timingss   keyss   funcs   ccs   nss   tts   cts   callerss   copys   ncs   func_caller(	   s   selfs   funcs   ccs   nss   tts   cts   callerss   ncs   func_callers$   /mit/python/lib/python2.0/profile.pys   snapshot_statsJs    		 	c    s5   XYd  k  } Z| i } [|  i | | | ƒ Sd  S(   N(   s   __main__s   __dict__s   dicts   selfs   runctxs   cmd(   s   selfs   cmds   __main__s   dicts$   /mit/python/lib/python2.0/profile.pys   runXs   c    s\   ]^|  i | ƒ _e i |  i ƒ `z a| | | UWd  bce i e ƒ Xd|  Sd  S(   N(	   s   selfs   set_cmds   cmds   syss
   setprofiles
   dispatchers   globalss   localss   None(   s   selfs   cmds   globalss   localss$   /mit/python/lib/python2.0/profile.pys   runctx]s   c    sY   gh|  i | ƒ it i |  i ƒ jz kt | | ƒ SWd  lmt i t ƒ Xd  S(   N(	   s   selfs   set_cmds   funcs   syss
   setprofiles
   dispatchers   applys   argss   None(   s   selfs   funcs   argss$   /mit/python/lib/python2.0/profile.pys   runcallgs   c    så   ›| } ž|  i ƒ  } Ÿx) Ÿ| o  |  i ƒ  ¡| d } q! W¢|  i ƒ  } £| | } ¦| } §|  i ƒ  } ¨x) ¨| o ©|  i ƒ  ª| d } q„ W«|  i ƒ  } ¬| | } ®| | | } °| Sd  S(   Ni   (   s   ms   ns   selfs   get_times   ss   simples   fs	   my_simples   instrumenteds   my_insts   avg_cost(   s   selfs   ms   ns   ss   fs	   my_simples   my_insts   avg_costs$   /mit/python/lib/python2.0/profile.pys	   calibrate›s$   	 
	 
c    s   ³´d } µd  S(   Ni   (   s   a(   s   selfs   as$   /mit/python/lib/python2.0/profile.pys   simple³s   	c    s&   ¸¹d } º|  i | | | ƒ d  S(   Ni   (   s   as   selfs   profiler_simulation(   s   selfs   as$   /mit/python/lib/python2.0/profile.pys   instrumented¸s   	c    s"   ½¾|  i ƒ  } À| |  _ d  S(   N(   s   selfs   timers   ts   ut(   s   selfs   xs   ys   zs   ts$   /mit/python/lib/python2.0/profile.pys   profiler_simulation½s   (   s   __doc__s   Nones   __init__s   get_times   get_time_macs   trace_dispatchs   trace_dispatch_is   trace_dispatch_macs   trace_dispatch_ls   trace_dispatch_exceptions   trace_dispatch_calls   trace_dispatch_returns   set_cmds	   fake_codes
   fake_frames   simulate_calls   simulate_cmd_completes   print_statss
   dump_statss   create_statss   snapshot_statss   runs   runctxs   runcalls	   calibrates   simples   instrumenteds   profiler_simulation(    s$   /mit/python/lib/python2.0/profile.pys   ProfileS s6   	$(

"


4s
   OldProfilec      s>   Äd  Z  ÌÎd „  Z Ôd „  Z ßd „  Z ñd „  Z RS(   s  A derived profiler that simulates the old style profile, providing
	errant results on recursive functions. The reason for the usefulness of
	this profiler is that it runs faster (i.e., less overhead).  It still
	creates all the caller stats, and is quite useful when there is *no*
	recursion in the user's code.
	
	This code also shows how easy it is to create a modified profiler.
	c 	   s[   ÎÏ|  i \ } } } } } } Ð| o | | j o Ñ|  i	 | | ƒ Sn Òd Sd  S(   Ni    (   s   selfs   curs   rts   rtts   rcts   rfns   rframes   rcurs   frames   trace_dispatch_returns   t(	   s   selfs   frames   ts   rts   rtts   rcts   rfns   rframes   rcurs$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_exceptionÎs   c    s¡   ÔÕ| i } ×| d d | | |  i f |  _ Ø|  i i | ƒ o6 Ù|  i | \ } } } Ú| | | f |  i | <n Üd d h  f |  i | <Ýd Sd  S(   Ni    i   (   s   frames   f_codes   fns   ts   selfs   curs   timingss   has_keys   tts   cts   callers(   s   selfs   frames   ts   fns   tts   cts   callerss$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_callÔs   !c    sú   ßà|  i \ } } } } } } á| | } â| | } ä| \ }	 }
 } } } } å|	 |
 | | | | | | f |  _ ç|  i | \ } } } è| i | ƒ o é| | d | | <n ëd | | <ì| | | | | f |  i | <îd Sd  S(   Ni   (   s   selfs   curs   rts   rtts   rcts   rfns   frames   rcurs   ts   sfts   pts   ptts   pcts   pfns   pframes   pcurs   timingss   tts   cts   callerss   has_key(   s   selfs   frames   ts   rts   rtts   rcts   rfns   rcurs   sfts   pts   ptts   pcts   pfns   pframes   pcurs   tts   cts   callerss$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_returnßs   &!c    sµ   ñòh  |  _ óxœ |  i i ƒ  d ór† } ô|  i | \ } } } õ| i ƒ  } öd } ÷x* | i ƒ  d ÷r } ø| | | } qp Wù| | | | | f |  i | <q$ Wd  S(   Ni    (   s   selfs   statss   timingss   keyss   funcs   tts   cts   callerss   copys   ncs   func_caller(   s   selfs   funcs   tts   cts   callerss   ncs   func_callers$   /mit/python/lib/python2.0/profile.pys   snapshot_statsñs    		 	(   s   __doc__s   trace_dispatch_exceptions   trace_dispatch_calls   trace_dispatch_returns   snapshot_stats(    s$   /mit/python/lib/python2.0/profile.pys
   OldProfileÄs
   	s
   HotProfilec      s>   ýd  Z  d „  Z 
d „  Z d „  Z d „  Z RS(   sú   The fastest derived profile example.  It does not calculate
	caller-callee relationships, and does not calculate cumulative
	time under a function.  It only calculates time spent in a
	function, so it runs very quickly due to its very low overhead.
	c    sX   |  i \ } } } } } | o | | j o |  i | | ƒ Sn d Sd  S(   Ni    (
   s   selfs   curs   rts   rtts   rfns   rframes   rcurs   frames   trace_dispatch_returns   t(   s   selfs   frames   ts   rts   rtts   rfns   rframes   rcurs$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_exceptions   c    s)   
| d | |  i f |  _ d Sd  S(   Ni    i   (   s   ts   frames   selfs   cur(   s   selfs   frames   ts$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_call
s   c    sÐ   |  i \ } } } } | i } | \ } } }	 }
 | | | |	 |
 f |  _ |  i i | ƒ o< |  i | \ } } | d | | | f |  i | <n d | | f |  i | <d Sd  S(   Ni   (   s   selfs   curs   rts   rtts   frames   rcurs   f_codes   rfns   pts   ptts   pframes   pcurs   timingss   has_keys   ncs   tt(   s   selfs   frames   ts   rts   rtts   rcurs   rfns   pts   ptts   pframes   pcurs   ncs   tts$   /mit/python/lib/python2.0/profile.pys   trace_dispatch_returns   &c    sj    h  |  _ !xQ |  i i ƒ  d !r; } "|  i | \ } } #| | | d h  f |  i | <q$ Wd  S(   Ni    (   s   selfs   statss   timingss   keyss   funcs   ncs   tt(   s   selfs   funcs   ncs   tts$   /mit/python/lib/python2.0/profile.pys   snapshot_statss
    	(   s   __doc__s   trace_dispatch_exceptions   trace_dispatch_calls   trace_dispatch_returns   snapshot_stats(    s$   /mit/python/lib/python2.0/profile.pys
   HotProfileýs
   	c     s   ()d GHd  S(   Ns7   Report generating functions are in the "pstats" module(    (   s   argss$   /mit/python/lib/python2.0/profile.pys   Stats(s   s   __main__i   s&   usage: profile.py scriptfile [arg] ...i   i    s	   execfile(s   )(   s   __doc__s   syss   oss   times   marshals   runs   helps   Profiles
   OldProfiles
   HotProfiles   Statss   __name__s   argvs   exits   filenames   paths   inserts   dirname(    s$   /mit/python/lib/python2.0/profile.pys   ?
 s*   ÿ r9+"