https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/profiling.cpython-310.pyc
o

�]Lb�"�@s�ddlmZmZddlZddlmZddlmZmZddl	m
Z
mZmZmZm
Z
dd�Zejd	d
��Zejdd��Zejd
d��ZGdd�de�ZdS)�)�absolute_import�print_functionN�)�_)�getattr�open)�encoding�error�
extensions�pycompat�utilcCsD|}tj||gd�zt�|�}Wn
tyYdSwt|dd�S)zBload profiler extension. return profile method, or None on failure)�	whitelistN�profile)r
�loadall�find�KeyErrorr)�ui�profiler�extname�mod�r�5/usr/lib/python3/dist-packages/mercurial/profiling.py�
_loadprofilers�rccsd�|�dd�}|�dd�}|�dd�}|�dd�}|dvr(|�td�|�d}zd	d
lm}Wnty>t�td���w|�	�}|j
dd
�z7dVW|��|dkrhd	dlm}|�
|�}	|	�|�dS|�|���}
|
�t�|��|
j|||d�dS|��|dkr�d	dlm}|�
|�}	|	�|�w|�|���}
|
�t�|��|
j|||d�w)N�	profilingsformatssortslimitsnested)�text�kcachegrinds-unrecognized profiling format '%s' - Ignored
rr)�lsprofsYlsprof not available - install from http://codespeak.net/svn/user/arigo/hack/misc/lsprof/T)�subcallsr)�lsprofcalltree)�limit�file�climit)�config�	configint�warnr�r�ImportErrorr	�Abort�Profiler�enable�disabler�KCacheGrind�output�Stats�getstats�sortr�sysstr�pprint)r�fp�format�fieldrr!r�pr�calltree�statsrrr�	lsprofile&sJ����
�
r8c
cs��zddlm}Wntyt�td���w|�dd�}d}d}|�|d|||�}t��}z%|�	�dVW|�
�|��tdt��||�
�|j
dd	�f�dS|�
�|��tdt��||�
�|j
dd	�f�w)
Nr)�
flamegraphsWflamegraph not available - install from https://github.com/evanhempel/python-flamegraphr�freqTg�?s7Collected %d stack frames (%d unique) in %2.2f seconds.)�unique)r9r&r	r'rr#�
ProfileThreadr�timer�start�stop�join�print�
num_frames)rr2r9�freq�filter_�collapse_recursion�thread�
start_timerrr�flameprofileMsP�����

����

���rHccsj�ddlm}|�dd�}|dkr|jjdkr|�|�n	|�td�|�|�ddt	j
r/dp0d	�}|jd
|d�zdVW|��}|�dd�}|j
j|j
j|j
j|j
j|j
jd
�}||vrc||}n
|�td�|�|j
j}i}	dd�}
|dkr�|�|
ddd�}|�|
dd�}|	j||d�n|dkr�|�|
ddd�}
|
|	d<|�dd�}||	d<|j|f||d�|	��dS|��}|�dd�}|j
j|j
j|j
j|j
j|j
jd
�}||vr�||}n
|�td�|�|j
j}i}	dd�}
|dk�r
|�|
ddd�}|�|
dd�}|	j||d�n|dk�r(|�|
ddd�}
|
|	d<|�dd�}||	d<|j|f||d�|	��w)Nr)�statprofrr:rs+invalid sampling frequency '%s' - ignoring
s
time-trackscpusrealsthread)�	mechanism�tracks
statformat)sbylinesbymethod�hotpathsjson�chromes#unknown profiler output format: %s
cSsft|ttf�rt|�S|�d�rt|dd��d}nt|�}d|kr*dkr/|St|��t|��)N�%����drr)�
isinstance�float�int�endswith�
ValueError)�s�vrrr�fraction�s
�zstatprofile.<locals>.fractionrMsshowming{�G�zt?sshowmax)�minthreshold�maxthresholdrLg�������?rsshowtime�showtime)�datar3)r%rIr#�state�
profile_level�resetr$rr"r�	iswindowsr>r?�DisplayFormats�ByLine�ByMethod�Hotpath�Json�Chrome�
configwith�update�
configbool�display)rr2rIrCrKr\�
profformat�formats�
displayformat�kwargsrX�showmin�showmaxrr[rrr�statprofileps|�
���
��


rqc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rz�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.
    TcCs:||_d|_d|_d|_d|_d|_||_d|_d|_dS)NTF)	�_ui�_output�_fp�
_fpdoclose�_flushfp�	_profiler�_enabled�_entered�_started)�selfr�enabledrrr�__init__�s
zprofile.__init__cCsd|_|jr
|��|S)NT)ryrxr>�r{rrr�	__enter__�szprofile.__enter__cCs`|jst�d��|jr
dSd|_tj�d�}d}|dur#|j�dd�}|dvr=t	|j|�}|dur=|j�
td�|�d	}|j�dd
�|_zb|jdkrQt
��|_n2|jrat
�|j�}t|d�|_n"tjrvGd
d�dt�}d|_||j�|_n
d|_|jj|_|jj|_|dur�n|dkr�t}n	|dkr�t}nt}||j|j�|_|j��WdS|���)z�Start profiling.

        The profiling will stop at the context exit.

        If the profiler was already started, this has no effect.suse a context manager to startNTsHGPROFrstype)�ls�stat�flames%unrecognized profiler '%s' - ignored
r�soutput�blackboxswbc@s$eZdZdd�Zdd�Zdd�ZdS)zprofile.start.<locals>.uifpcSs
||_dS�N)rr)r{rrrrr}�s
z$profile.start.<locals>.uifp.__init__cSs|j�|�dSr�)rr�	write_err)r{r\rrr�write�sz!profile.start.<locals>.uifp.writecSs|j��dSr�)rr�flushr~rrrr��sz!profile.start.<locals>.uifp.flushN)�__name__�
__module__�__qualname__r}r�r�rrrr�uifp�sr�Fr�r�)ryr	�ProgrammingErrorrzr�environ�getrrr"rr$rrsr�stringiort�
expandpathrrr`�objectru�ferr�foutrvr8rHrqrwr�_closefp)r{r�proffn�pathr�rrrr>�sT

�



z
profile.startcCsdd}|jdur,|��|j�|||�}|jdkr,d|j��}|�dd�}|j�d|�|�	�|S)Nr�sProfile:
%srNs%%sprofile)
rw�_uiflush�__exit__rsrt�getvalue�replacerr�logr�)r{�exception_type�exception_value�	traceback�	propagate�valrrrr�s
�
zprofile.__exit__cCs&|jr|jdur|j��dSdSdSr�)rurt�closer~rrrr�s�zprofile._closefpcCs|jr
|j��dSdSr�)rvr�r~rrrr� s�zprofile._uiflushN)T)
r�r�r��__doc__r}rr>r�r�r�rrrrr�s
Cr)�
__future__rr�
contextlib�i18nrrrrr%rr	r
rr�contextmanagerr8rHrqr�rrrrr�<module>s	
&
"
@

https://t.me/RX1948 - 2025