b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/profile.pyc
Size16.29 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:28
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc
@sVdZddkZddkZddkZddkZddklZddddgZedd�Z ed �Z
d
�Z ei d joddk
Z
e
id �Zneed
�oeid�ZndZy+ddkZd�Zed�ZdZWnej
onXdfd��YZd�Zd�Zedjo e�ndS(s Class for profiling Python code.iÿÿÿÿN(t OptionParsertruntrunctxthelptProfilecCsat�}y|i|�}Wntj
onX|dj o|i|�n|i|�SdS(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(RRt
SystemExittNonet
dump_statst print_stats(t statementtfilenametsorttprof((s/usr/lib64/python2.6/profile.pyR9s 
cCsdt�}y|i|||�}Wntj
onX|dj o|i|�n |i�SdS(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(R tglobalstlocalsR
R ((s/usr/lib64/python2.6/profile.pyRNs 
cCsdGHdGHdS(Ns2Documentation for the profile module can be found s?in the Python Library Reference, section 'The Python Profiler'.((((s/usr/lib64/python2.6/profile.pyR`stmaccCs |�dS(NgN@((ttimer((s/usr/lib64/python2.6/profile.pyt
_get_time_macfsttimescCs|�}|d|dS(Nii((Rtt((s/usr/lib64/python2.6/profile.pyt_get_time_timesjs icCstiti�S((tresourcet getrusaget RUSAGE_SELF(((s/usr/lib64/python2.6/profile.pyt<lambda>uscCs|�}|d|dS(Nii((RR((s/usr/lib64/python2.6/profile.pyt_get_time_resourcevs icBs3eZdZdZd"d"d�Zd�Zd�Zd�Zd�Z d�Z
d�Z d �Z d
�Z
he d 6e
d 6e
d
6e d6e
d6e
d6Zd�Zdd#d��YZdd$d��YZd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd �Zd!�ZRS(%sProfiler 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 (frame and previous tuple). In case an internal error is
detected, the -3 element is used as the function name.

[ 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 (this latter is tallied in cur[2]).
[ 2] = Total time spent in subfunctions, excluding time executing the
frame's function (this latter is tallied in cur[1]).
[-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[-3].
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.
[4] = A dictionary indicating for each function name, the number of times
it was called by us.
icCsèh|_d|_d|_d|_|djo
|i}n||_|péto"t|_|i |_
t |_ qÈt
idjo%ti|_|i|_
t|_ qÈttd�o#ti|_|_ |i|_
qÈtt
d�o%t
i|_|i |_
t|_ qÈti|_|_ |i|_
n�||_|i�}yt|�}Wn(tj
o||_ |i|_
nCX|djo|i |_
n
|i|_
|td�}||_ |i �|_|id�dS(NtRtclockRicSs
||��S(N((Rtsum((s/usr/lib64/python2.6/profile.pytget_time_timerÕstprofiler(ttimingsRtcurtcmdt c_func_nametbiast_has_rest resgetrusageRttrace_dispatcht
dispatcherRtget_timetostnametMacOStGetTicksttrace_dispatch_macRthasattrttimeRttrace_dispatch_iRRtlent TypeErrorttrace_dispatch_lRRt
simulate_call(tselfRR#RtlengthR((s/usr/lib64/python2.6/profile.pyt__init__¦sN    

   
  
  
   
  cCs±|i}|�}|d|d|i|i}|djo|i|_n|i||||�o"|�}|d|d|_n#|�}|d|d||_dS(Niitc_call(RRR#t__name__R"tdispatch(R5tframeteventtargRRtr((s/usr/lib64/python2.6/profile.pyR&Ýs   
  cCs{|i}|�|i|i}|djo|i|_n|i||||�o|�|_n|�||_dS(NR8(RRR#R9R"R:(R5R;R<R=RR((s/usr/lib64/python2.6/profile.pyR0ïs 
cCs�|i}|�d|i|i}|djo|i|_n|i||||�o|�d|_n|�d||_dS(NgN@R8(RRR#R9R"R:(R5R;R<R=RR((s/usr/lib64/python2.6/profile.pyR-þs 
cCs{|i}|�|i|i}|djo|i|_n|i||||�o|�|_n|�||_dS(NR8(R(RR#R9R"R:(R5R;R<R=R(R((s/usr/lib64/python2.6/profile.pyR3 s 
c Csc|i\}}}}}}||j o|o|i||�S|||||||f|_dS(Ni(R ttrace_dispatch_return( R5R;Rtrpttrittrettrfntrframetrcur((s/usr/lib64/python2.6/profile.pyttrace_dispatch_exceptions
cCs�|ioÐ|i|idj o¹|i\}}}}}}t|ti�p�|i|ijp"td|||i||if�|i|d�|idjp.|i|idjptd|idf�qÚn|i} | i | i
| i f}
|dd|
||if|_|i } |
| jo:| |
\} }
}}}| |
d|||f| |
<nddddhf| |
<dS(NiþÿÿÿsBad calliiýÿÿÿi(
R tf_backt
isinstanceRt
fake_frametAssertionErrorR?Rtf_codet co_filenametco_firstlinenotco_nameR(R5R;RR@RARBRCRDREtfcodetfnRtcctnsttttcttcallers((s/usr/lib64/python2.6/profile.pyttrace_dispatch_call's&!   
!c
Cs�dd|if}|dd|||if|_|i}||jo:||\}}}}} ||d||| f||<nddddhf||<dS(NRii(R"R R(
R5R;RRPRRQRRRSRTRU((s/usr/lib64/python2.6/profile.pyttrace_dispatch_c_call=s 
!cCsZ||idj oI||idijptd|idf�|i|idd�n|i\}}}}}}||}||}|\} }
} } }
}| |
|| || |
|f|_|i}||\}}}}}|p||}|d}n| |jo|| d|| <n d|| <||d||||f||<dS(Niþÿÿÿs
Bad returniýÿÿÿii(R RGRJR?R(R5R;RR@RARBRCREt frame_totaltppttpittpettpfntpframetpcurRRQRRRSRTRU((s/usr/lib64/python2.6/profile.pyR?Hs$.

# 


!tcallt exceptiontreturnR8t c_exceptiontc_returncCs-|idodS||_|i|�dS(Niÿÿÿÿ(R R!R4(R5R!((s/usr/lib64/python2.6/profile.pytset_cmd~s t fake_codecBseZd�Zd�ZRS(cCs(||_||_||_d|_dS(Ni(RLtco_lineRNRM(R5R
tlineR*((s/usr/lib64/python2.6/profile.pyR7�s   cCst|i|i|if�S(N(treprRLRfRN(R5((s/usr/lib64/python2.6/profile.pyt__repr__�s(R9t
__module__R7Ri(((s/usr/lib64/python2.6/profile.pyRe�s RIcBseZd�ZRS(cCs||_||_dS(N(RKRG(R5tcodetprior((s/usr/lib64/python2.6/profile.pyR7�s (R9RjR7(((s/usr/lib64/python2.6/profile.pyRI�scCsc|idd|�}|io|id}nd}|i||�}|id||d�dS(NtprofileiiþÿÿÿR_(ReR RRIR:(R5R*RkR]R;((s/usr/lib64/python2.6/profile.pyR4�s 
cCsg|i}|�|i}x7|ido(|id||id|�d}qW|�||_dS(NiÿÿÿÿRaiþÿÿÿi(R(RR R:(R5R(R((s/usr/lib64/python2.6/profile.pytsimulate_cmd_complete�s  iÿÿÿÿcCs2ddk}|i|�i�i|�i�dS(Niÿÿÿÿ(tpstatstStatst
strip_dirst
sort_statsR(R5R Ro((s/usr/lib64/python2.6/profile.pyR©s cCs:t|d�}|i�ti|i|�|i�dS(Ntwb(topent create_statstmarshaltdumptstatstclose(R5tfiletf((s/usr/lib64/python2.6/profile.pyR®s
cCs|i�|i�dS(N(Rntsnapshot_stats(R5((s/usr/lib64/python2.6/profile.pyRu´s
c Cs�h|_x{|ii�D]j\}\}}}}}|i�}d}x|i�D]}||7}qSW|||||f|i|<qWdS(Ni(RxRt iteritemstcopyt
itervalues( R5tfuncRQRRRSRTRUtnctcallcnt((s/usr/lib64/python2.6/profile.pyR|¸s  
cCs(ddk}|i}|i|||�S(Niÿÿÿÿ(t__main__t__dict__R(R5R!R�tdict((s/usr/lib64/python2.6/profile.pyRÅs  cBs@|i|�ei|i�z|||UWdeid�X|S(N(Rdtsyst
setprofileR'R(R5R!R
R((s/usr/lib64/python2.6/profile.pyRÊs 
cOsI|it|��ti|i�z|||�SWdtid�XdS(N(RdRhR�R�R'R(R5R�targstkw((s/usr/lib64/python2.6/profile.pytruncallÔs
cCsW|itj otd��n|i}d|_z|i||�SWd||_XdS(Ns&Subclasses must override .calibrate().i(t __class__RR2R#t_calibrate_inner(R5tmtverboset
saved_bias((s/usr/lib64/python2.6/profile.pyt calibrates  cCs�|i}d�}|d�}||�|�}||�|�}||}|o
dG|GHnt�} |�}| idt�t��|�}||}
|o
dG|
GHnd} d} xZ| ii�D]I\\}
}}\}}}}}|djo| |7} | |7} qÐqÐW|od G| GHd
G| GHn| |d jotd | ��n| |d
| }|o
dG|GHn|S(NcSs!xt|�D] }d}q
WdS(Ni(trange(tntitx((s/usr/lib64/python2.6/profile.pytf1s
cSs%xt|�D]}|d�q
WdS(Nid(R�(R�R�R�((s/usr/lib64/python2.6/profile.pyR{s
s elapsed time without profiling =sf(m)selapsed time with profiling =gR{R�s!'CPU seconds' profiler reported =stotal # calls =is internal error: total calls = %dg@s+mean stopwatch overhead per profile event =(R{sf1(R(RRR
RRtitemst
ValueError(R5R�R�R(R�R{tt0tt1telapsed_noprofiletptelapsed_profilet total_callst
reported_timeR
RgtfuncnameRQRRRSRTRUtmean((s/usr/lib64/python2.6/profile.pyR�sD   
 
 

   


$

 

N(((R9Rjt__doc__R#RR7R&R0R-R3RFRVRWR?R:RdReRIR4RnRRRuR|RRR�R�R�(((s/usr/lib64/python2.6/profile.pyR}s@%7       &


   

1 cGs dGHdS(Ns7Report generating functions are in the "pstats" module((R�((s/usr/lib64/python2.6/profile.pyRpOsc Csd}td|�}t|_|iddddddd d�|id
d dd dd
d d�tidp|i�tid�n|i �\}}t
|�djoX|ti(ti i dt
i itid��tdtidf|i|i�n |i�|S(Ns?profile.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 classiÿÿÿÿiiis execfile(%r)(RtFalsetallow_interspersed_argst
add_optionRR�targvt print_usagetexitt
parse_argsR1tpathtinsertR)tdirnameRR¤R (R¢tparsertoptionsR�((s/usr/lib64/python2.6/profile.pytmainRs" 



&(
R�(R¡R�R)R/RvtoptparseRt__all__RRRRR*R+R,RR.RRR$RR%Rt ImportErrorRRpR²R9(((s/usr/lib64/python2.6/profile.pyt<module>s8          
ÿÓ