HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/usr/lib64/python2.7/site-packages/mercurial/profiling.pyc
�
1�3\c@@s�ddlmZmZddlZddlmZddlmZmZm	Z	m
Z
mZd�Zej
d��Zej
d��Zej
d	��Zd
efd��YZdS(i(tabsolute_importtprint_functionNi(t_(tencodingterrort
extensionstpycompattutilcC@sX|}tj|d|g�ytj|�}Wntk
rCdSXt|dd�SdS(sBload profiler extension. return profile method, or None on failuret	whitelisttprofileN(RtloadalltfindtKeyErrortNonetgetattr(tuitprofilertextnametmod((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt
_loadprofilers
c
c@sj|jdd�}|jdd�}|jdd�}|jdd�}|dkrt|jtd�|�d}nyd	d
lm}Wn&tk
r�tjtd���nX|j	�}|j
dt�z	dVWd|j�|dkrd	d
lm
}|j|�}	|	j|�nG|j|j��}
|
jtj|��|
jd|d|d|�XdS(Nt	profilingtformattsorttlimittnestedttexttkcachegrinds-unrecognized profiling format '%s' - Ignored
i(tlsprofsYlsprof not available - install from http://codespeak.net/svn/user/arigo/hack/misc/lsprof/tsubcalls(tlsprofcalltreetfiletclimit(RR(tconfigt	configinttwarnRtRtImportErrorRtAborttProfilertenabletTruetdisableRtKCacheGrindtoutputtStatstgetstatsRRtsysstrtpprint(RtfpRtfieldRRRtpRtcalltreetstats((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt	lsprofile s2	
		
c
c@s�yddlm}Wn&tk
r<tjtd���nX|jdd�}d}t}|j|d|||�}t	j
�}z|j�dVWd|j�|j
�tdt	j
�||j�|jdt�f�XdS(	Ni(t
flamegraphsWflamegraph not available - install from https://github.com/evanhempel/python-flamegraphRtfreqg�?s7Collected %d stack frames (%d unique) in %2.2f seconds.tunique(R6R$RR%RR!R
R(t
ProfileThreadRttimertstarttstoptjointprintt
num_frames(RR0R6R7tfilter_tcollapse_recursiontthreadt
start_time((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pytflameprofileCs&
	
	

c
c@sddlm}|jdd�}|dkrS|jjdkrj|j|�qjn|jtd�|�|jddt	j
r�dp�d	�}|jd
dd|�z	dVWd|j�}|jdd
�}i|j
jd6|j
jd6|j
jd6|j
jd6|j
jd6}||kr.||}n#|jtd�|�|j
j}i}	d�}
|dkr�|j|
ddd�}|j|
dd�}|	jd|d|�n1|dkr�|j|
ddd�}
|
|	d<n|j|d|d||	�XdS(Ni(tstatprofRR7is+invalid sampling frequency '%s' - ignoring
s
time-tracktcputrealt	mechanismRBttrackt
statformattbylinetbymethodthotpathtjsontchromes#unknown profiler output format: %s
cS@s�t|ttf�rt|�S|jd�rEt|d �d}nt|�}d|kohdknrq|St|��dS(Nt%i����idii(t
isinstancetfloattinttendswitht
ValueError(tstv((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pytfraction�s
tshowming{�G�zt?tshowmaxtminthresholdtmaxthresholdg�������?RtdataR(R#RER!tstatet
profile_leveltresetR"RR Rt	iswindowsR;R<tDisplayFormatstByLinetByMethodtHotpathtJsontChromet
configwithtupdatetdisplay(RR0RER7RIR]t
profformattformatst
displayformattkwargsRXRYRZR((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pytstatprofile\sB	




	
R	cB@s>eZdZed�Zd�Zd�Zd�Zd�ZRS(s�Start profiling.

    Profiling is active when the context manager is active. When the context
    manager exits, profiling results will be written to the configured output.
    cC@sL||_d|_d|_t|_d|_||_t|_	t|_
dS(N(t_uiR
t_outputt_fpR(t
_fpdocloset	_profilert_enabledtFalset_enteredt_started(tselfRtenabled((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt__init__�s							cC@s#t|_|jr|j�n|S(N(R(RwRuR;(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt	__enter__�s		
cC@s�|jstj��n|jr%dSt|_tjjd�}d}|dkrj|j	j
dd�}n|dkr�t|j	|�}|dkr�|j	jt
d�|�d}q�n|j	j
dd	�|_y|jd
kr�tj�|_n�|jr)|j	j|j�}t|d�|_nUtjrfdtfd
��Y}t|_||j	�|_nt|_|j	j|_|dk	r�n0|dkr�t}n|dkr�t}nt}||j	|j�|_|jj�Wn|j��nXdS(s�Start profiling.

        The profiling will stop at the context exit.

        If the profiler was already started, this has no effect.NtHGPROFRttypetlststattflames%unrecognized profiler '%s' - ignored
R+tblackboxtwbtuifpcB@s#eZd�Zd�Zd�ZRS(cS@s
||_dS(N(Rp(RyR((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR{�scS@s|jj|�dS(N(Rpt	write_err(RyR]((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pytwrite�scS@s|jj�dS(N(Rptflush(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR��s(t__name__t
__module__R{R�R�(((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR��s		(RR�R�( RwRtProgrammingErrorRxR(RtenvirontgetR
RpR RR"RRqRtstringioRrt
expandpathtopenRRatobjectRvRstferrR5RDRoRtR|t_closefp(RyRtproffntpathR�((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR;�sP									
cC@s�d}|jdk	rz|jj|||�}|jdkrzd|jj�}|jdd�}|jjd|�qzn|j	�|S(NR�sProfile:
%sRPs%%R	(
R
Rtt__exit__RqRrtgetvaluetreplaceRptlogR�(Rytexception_typetexception_valuet	tracebackt	propagatetval((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR��s	
cC@s,|jr(|jdk	r(|jj�ndS(N(RsRrR
tclose(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR��s(	R�R�t__doc__R(R{R|R;R�R�(((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR	�s
		=	(t
__future__RRt
contextlibti18nRR#RRRRRRtcontextmanagerR5RDRoR�R	(((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt<module>s(	#=