ó ő^‚Rc@sdZddddgZddlZddd„Zddd„Zd „Zdejfd „ƒYZd „Z d „Z e d krŒe ƒndS(sUPython interface for the 'lsprof' profiler. Compatible with the 'profile' module. truntrunctxthelptProfilei˙˙˙˙NcCsmtƒ}d}z+y|j|ƒ}Wntk r8nXWd|dk rY|j|ƒn|j|ƒ}X|S(sRun statement under profiler optionally saving results in filename This function takes a single argument that can be passed to the "exec" statement, and an optional file name. In all cases this routine attempts to "exec" its first argument and gather profiling statistics from the execution. If no file name is present, then this function automatically prints a simple profiling report, sorted by the standard name string (file/line/function-name) that is presented in each line. N(RtNoneRt SystemExitt dump_statst print_stats(t statementtfilenametsorttproftresult((s/usr/lib/python2.7/cProfile.pyRs   cCsstƒ}d}z1y|j|||ƒ}Wntk r>nXWd|dk r_|j|ƒn|j|ƒ}X|S(sˇRun statement under profiler, supplying your own globals and locals, optionally saving results in filename. statement and filename have the same semantics as profile.run N(RRRRRR(RtglobalstlocalsR R R R ((s/usr/lib/python2.7/cProfile.pyR's   cCsdGHdGHdS(Ns<Documentation for the profile/cProfile modules can be found s?in the Python Library Reference, section 'The Python Profiler'.((((s/usr/lib/python2.7/cProfile.pyR<scBsPeZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS( siProfile(custom_timer=None, time_unit=None, subcalls=True, builtins=True) Builds a profiler object using the specified timer function. The default timer is a fast built-in one based on real time. For custom timer functions returning integers, time_unit can be a float specifying a scale (i.e. how long each integer unit is, in seconds). i˙˙˙˙cCs2ddl}|j|ƒjƒj|ƒjƒdS(Ni˙˙˙˙(tpstatstStatst strip_dirst sort_statsR(tselfR R((s/usr/lib/python2.7/cProfile.pyROs cCsFddl}t|dƒ}|jƒ|j|j|ƒ|jƒdS(Ni˙˙˙˙twb(tmarshaltopent create_statstdumptstatstclose(RtfileRtf((s/usr/lib/python2.7/cProfile.pyRSs   cCs|jƒ|jƒdS(N(tdisabletsnapshot_stats(R((s/usr/lib/python2.7/cProfile.pyRZs c Cs™|jƒ}i|_i}xz|D]r}t|jƒ}|j}||j}|j}|j}i} | |t|jƒ<||||| f|j|                 cCs(ddl}|j}|j|||ƒS(Ni˙˙˙˙(t__main__t__dict__R(RtcmdR4tdict((s/usr/lib/python2.7/cProfile.pyR„s  cBs*|jƒz|||UWd|jƒX|S(N(tenableR(RR6R R((s/usr/lib/python2.7/cProfile.pyR‰s   cOs-|jƒz|||ŽSWd|jƒXdS(N(R8R(RR,targstkw((s/usr/lib/python2.7/cProfile.pytruncall’s ( t__name__t __module__t__doc__RRRRRRR;(((s/usr/lib/python2.7/cProfile.pyRBs    &  cCs6t|tƒrdd|fS|j|j|jfSdS(Nt~i(t isinstancetstrt co_filenametco_firstlinenotco_name(R!((s/usr/lib/python2.7/cProfile.pyR ›s c Cs€ddl}ddl}ddlm}d}|d|ƒ}t|_|jddddd d d dƒ|jd d ddd dd dƒ|jdsą|j ƒ|j dƒn|j ƒ\}}||j(t |ƒdkrr|d}|j jd|j j|ƒƒt|dƒ}t|jƒ|dƒ} WdQXi|d6dd6dd6} t| | d|j|jƒn |j ƒ|S(Ni˙˙˙˙(t OptionParsers@cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ...tusages-os --outfiletdesttoutfileRsSave stats to tdefaults-ss--sortR s?Sort order when printing to stdout, based on pstats.Stats classiiitrbtexect__file__R4R<t __package__(tostsystoptparseREtFalsetallow_interspersed_argst add_optionRtargvt print_usagetexitt parse_argstlentpathtinserttdirnameRtcompiletreadRRHR ( RNRORERFtparsertoptionsR9tprognametfpR!tglobs((s/usr/lib/python2.7/cProfile.pytmainŁs6        R4( R>t__all__t_lsprofRRRRtProfilerRR RcR<(((s/usr/lib/python2.7/cProfile.pyts  Y  #