Current File : //proc/thread-self/root/usr/lib64/python2.7/cProfile.pyo
�
zfc@s�dZddddgZddlZddd�Zddd�Zd �Zdejfd
��YZd�Z d�Z
ed
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_statstprint_stats(t statementtfilenametsorttproftresult((s /usr/lib64/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
RR((s /usr/lib64/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/lib64/python2.7/cProfile.pyR<scBsPeZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z RS( s`Profile(timer=None, timeunit=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, timeunit 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/lib64/python2.7/cProfile.pyROscCsFddl}t|d�}|j�|j|j|�|j�dS(Ni����twb(tmarshaltopentcreate_statstdumptstatstclose(RtfileRtf((s /usr/lib64/python2.7/cProfile.pyRSs
cCs|j�|j�dS(N(tdisabletsnapshot_stats(R((s /usr/lib64/python2.7/cProfile.pyRZs
cCs�|j�}i|_i}xz|D]r}t|j�}|j}||j}|j}|j}i} | |t|j�<||||| f|j|<q"Wx�|D]�}|j r�t|j�}x�|j D]�}
y|t|
j�} Wnt
k
r�q�nX|
j}||
j}|
j}|
j}|| krt| |}||d7}||d7}||d7}||d7}n||||f| |<q�Wq�q�WdS(Niiii(tgetstatsRtlabeltcodet callcounttreccallcountt
inlinetimet totaltimetidtcallstKeyError(Rtentriestcallersdictstentrytfunctnctccttttcttcallerstsubentrytprev((s /usr/lib64/python2.7/cProfile.pyR^s>
cCs(ddl}|j}|j|||�S(Ni����(t__main__t__dict__R(RtcmdR4tdict((s /usr/lib64/python2.7/cProfile.pyR�s cBs*|j�z|||UWd|j�X|S(N(tenableR(RR6R
R((s /usr/lib64/python2.7/cProfile.pyR�s
cOs-|j�z|||�SWd|j�XdS(N(R8R(RR,targstkw((s /usr/lib64/python2.7/cProfile.pytruncall�s
(
t__name__t
__module__t__doc__RRRRRRR;(((s /usr/lib64/python2.7/cProfile.pyRBs & cCs6t|t�rdd|fS|j|j|jfSdS(Nt~i(t
isinstancetstrtco_filenametco_firstlinenotco_name(R!((s /usr/lib64/python2.7/cProfile.pyR �s
cCs�ddl}ddl}ddl}ddlm}d}|d|�}t|_|jddddd d
dd�|jdd
ddd ddddt |j
j��|jds�|j
�|jd�n|j�\}}||j(t|�dkr�|d}|jjd|jj|��t|d��} t| j�|d�}
WdQXi|d6dd6dd6}t|
|d|j|j�n
|j
�|S(Ni����(tOptionParsers@cProfile.py [-o output_file_path] [-s sort] scriptfile [arg] ...tusages-os --outfiletdesttoutfileRsSave stats to <outfile>tdefaults-ss--sortR
s?Sort order when printing to stdout, based on pstats.Stats classtchoicesiiitrbtexect__file__R4R<t__package__(tostsysRtoptparseREtFalsetallow_interspersed_argst
add_optionRtsortedRtsort_arg_dict_defaulttargvtprint_usagetexitt
parse_argstlentpathtinserttdirnameRtcompiletreadRRHR
(RORPRRERFtparsertoptionsR9tprognametfpR!tglobs((s /usr/lib64/python2.7/cProfile.pytmain�s8$
R4(R>t__all__t_lsprofRRRRtProfilerRR RfR<(((s /usr/lib64/python2.7/cProfile.pyt<module>s Y $