Your IP : 3.144.104.118


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/profile.cpython-312.opt-2.pyc

�

�Q�fBZ���	ddlZddlZddlZddlZddlZgd�ZGd�d�Zdd�Zdd�Z	Gd�d�Z
d	�Zed
k(re�yy)�N)�run�runctx�Profilec�&�eZdZ	d�Zd�Zd�Zd�Zy)�_Utilsc��||_y�N)�profiler)�selfr
s  �./opt/alt/python312/lib64/python3.12/profile.py�__init__z_Utils.__init__1s	�� ��
�c��|j�}	|j|�|j|||�y#t$rY�wxYw#|j|||�wxYwr	)r
r�
SystemExit�_show)r�	statement�filename�sort�profs     rrz
_Utils.run4sW���}�}���	-��H�H�Y��
�J�J�t�X�t�,���	��	��
�J�J�t�X�t�,�s!�7�	A�A�A�A�Ac��|j�}	|j|||�|j|||�y#t$rY�wxYw#|j|||�wxYwr	)r
rrr)rr�globals�localsrrrs       rrz
_Utils.runctx=s[���}�}���	-��K�K�	�7�F�3�
�J�J�t�X�t�,���	��	��
�J�J�t�X�t�,�s!�9�	A�A�A�A�Ac�N�|�|j|�y|j|�yr	)�
dump_stats�print_stats)rrrrs    rrz_Utils._showFs"�����O�O�H�%����T�"rN)�__name__�
__module__�__qualname__r
rrr�rrrr+s���
!�-�-�#rrc�D�	tt�j|||�Sr	)rrr)rrrs   rrrRs"��	��'�?���y�(�D�9�9rc�H�	tt�j|||||�Sr	)rrr)rrrrrs     rrr_s&���
�'�?�!�!�)�W�f�h��M�Mrc���eZdZ	dZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Ze
e	eeeed�Z
d
�ZGd�d�ZGd�d�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zy) rrNc��i|_d|_d|_d|_|�|j}||_|s.t
jx|_|_|j|_
n\||_|j�}	t|�}|dk(r|j|_
n|j|_
|tfd�}||_|j�|_|j#d�y#t$r||_|j|_
Y�JwxYw)N��c��||��Sr	r)�timer�sums  r�get_time_timerz(Profile.__init__.<locals>.get_time_timer�s���u�w�<�'rr
)�timings�cur�cmd�c_func_name�bias�time�process_timer'�get_time�trace_dispatch_i�
dispatcher�len�trace_dispatch�trace_dispatch_lr(�	TypeError�t�
simulate_call)rr'r.r8�lengthr)s      rr
zProfile.__init__�s����������������<��9�9�D���	��)-�):�):�:�D�J���"�3�3�D�O��D�J��
�
��A�
/��Q���
�Q�;�&*�&9�&9�D�O�&*�&;�&;�D�O�*/�C�(� .��
����������:�&��#�
8� %��
�"&�"7�"7���
8�s�:C%�%!D	�D	c�2�|j}|�}|d|dz|jz
|jz
}|dk(r|j|_|j
||||�r|�}|d|dz|_y|�}|d|dz|z
|_y)Nr��c_call�r'r8r.rr-�dispatch)r�frame�event�argr'r8�rs       rr5zProfile.trace_dispatch�s����
�
���G��
�a�D�1�Q�4�K�$�&�&� �4�9�9�,���H��"�|�|�D���4�=�=����e�A�.���A��q�T�A�a�D�[�D�F���A��q�T�A�a�D�[�1�_�D�Frc���|j}|�|jz
|jz
}|dk(r|j|_|j
||||�r
|�|_y|�|z
|_y�Nr=r>�rr@rArBr'r8s      rr2zProfile.trace_dispatch_i�se���
�
���G�d�f�f��t�y�y�(���H��"�|�|�D���4�=�=����e�Q�/��W�D�F��W�q�[�D�Frc��|j}|�dz|jz
|jz
}|dk(r|j|_|j
||||�r|�dz|_y|�dz|z
|_y)NgN@r=r>rFs      r�trace_dispatch_maczProfile.trace_dispatch_mac�sr���
�
���G�D�L�4�6�6�!�D�I�I�-���H��"�|�|�D���4�=�=����e�Q�/��W�T�\�D�F��W�T�\�A�%�D�Frc���|j}|�|jz
|jz
}|dk(r|j|_|j
||||�r
|�|_y|�|z
|_yrE)r1r8r.rr-r?)rr@rArBr1r8s      rr6zProfile.trace_dispatch_l�se���=�=���J�����$�)�)�+���H��"�|�|�D���4�=�=����e�Q�/��Z�D�F��Z�!�^�D�Frc�z�|j\}}}}}}||ur|r|j||�S|||z||||f|_y�Nr<)r+�trace_dispatch_return)	rr@r8�rpt�rit�ret�rfn�rframe�rcurs	         r�trace_dispatch_exceptionz Profile.trace_dispatch_exception�sP��+/�8�8�(��S�#�s�F�D��%��T��-�-�f�a�8�8���A��s�C���5���rc���|jrZ|j|jdur?|j\}}}}}}t|tj�s|j|d�|j}	|	j|	j|	jf}
|dd|
||jf|_|j}|
|vr||
\}}
}}}||
dz|||f||
<yddddif||
<y�N���rr<)r+�f_back�
isinstancer�
fake_framerL�f_code�co_filename�co_firstlineno�co_namer*)rr@r8rMrNrOrPrQrR�fcode�fnr*�cc�ns�tt�ct�callerss                 r�trace_dispatch_callzProfile.trace_dispatch_calls����8�8����D�H�H�R�L�8�/3�x�x�,�C��c�3����f�g�&8�&8�9��*�*�6�1�5���������!5�!5�u�}�}�
E���q�!�R�����1����,�,��
��=�&-�b�k�#�B��B��G��b�1�f�b�"�g�5�G�B�K���Q��1�b�.�G�B�K�rc��dd|jf}|dd|||jf|_|j}||vr||\}}}}}	||dz|||	f||<yddddif||<y)Nr$rr<)r-r+r*)
rr@r8r_r*r`rarbrcrds
          r�trace_dispatch_c_callzProfile.trace_dispatch_c_calls����!�T�%�%�
&���q�!�R�����1����,�,��
��=�&-�b�k�#�B��B��G��b��d�B��G�3�G�B�K���Q��1�b�.�G�B�K�rc�f�||jdur|j|jdd�|j\}}}}}}||z}||z}|\}	}
}}}
}|	|
|z||z||
|f|_|j}||\}}}}}|s
||z}|dz}||vr||dz||<nd||<||dz
||z||f||<yrU)r+rLr*)rr@r8rMrNrOrPrR�frame_total�ppt�pit�pet�pfn�pframe�pcurr*r`rarbrcrds                     rrLzProfile.trace_dispatch_return#s���������$��&�&�t�x�x��|�Q�7�
+/�(�(�'��S�#�s�E�4��A�g���C�i��+/�(��S�#�s�F�D���c�	�3��#4�c�6�4�G����,�,��")�#�,���B��B���
�k�!�B��a��B��'�>�"�3�<�!�+�G�C�L�
�G�C�L��2��6�2��8�R��8����r)�call�	exception�returnr=�c_exception�c_returnc�T�|jdry||_|j|�y�N���)r+r,r9)rr,s  r�set_cmdzProfile.set_cmdYs$���8�8�B�<��������3�rc��eZdZd�Zd�Zy)�Profile.fake_codec�<�||_||_||_d|_y�Nr)r[�co_liner]r\)rr�line�names    rr
zProfile.fake_code.__init___s ��'�D���D�L��D�L�"#�D�rc�Z�t|j|j|jf�Sr	)�reprr[r}r]�rs r�__repr__zProfile.fake_code.__repr__es"����)�)�4�<�<����F�G�GrN)rrrr
r�rrr�	fake_coderz^s
��	$�	Hrr�c��eZdZd�Zy)�Profile.fake_framec� �||_||_yr	)rZrW)r�code�priors   rr
zProfile.fake_frame.__init__is���D�K��D�KrN)rrrr
rrrrYr�hs��	 rrYc��|jdd|�}|jr|jd}nd}|j||�}|jd||d�y)N�profilerrVrp)r�r+rYr?)rrr�rnr@s     rr9zProfile.simulate_callmsT���~�~�i��D�1���8�8��X�X�b�\�F��F�����f�-����
�
�f��d�E�1�-rc���|j}|�|jz
}|jdr6|jd||jd|�d}|jdr�6|�|z
|_y)NrwrrrVr)r1r8r+r?)rr1r8s   r�simulate_cmd_completezProfile.simulate_cmd_completeysh���=�=���J�������h�h�r�l�
$�D�M�M�(�#�D�$�(�(�2�,��:��A�	�h�h�r�l�
��a���rc��ddl}|j|�j�j|�j	�yr|)�pstats�Stats�
strip_dirs�
sort_statsr)rrr�s   rrzProfile.print_stats�s,������T��%�%�'�2�2�4�8��+�-rc��t|d�5}|j�tj|j|�ddd�y#1swYyxYw)N�wb)�open�create_stats�marshal�dump�stats)r�file�fs   rrzProfile.dump_stats�s8��
�$��
�������L�L����Q�'��
�
�s�1A�Ac�D�|j�|j�yr	)r��snapshot_statsr�s rr�zProfile.create_stats�s���"�"�$����rc���i|_|jj�D]K\}\}}}}}|j�}d}|j	�D]}||z
}�	|||||f|j|<�Myr|)r�r*�items�copy�values)	r�funcr`rarbrcrd�nc�callcnts	         rr�zProfile.snapshot_stats�st����
�/3�|�|�/A�/A�/C�+�D�+�2�r�2�r�7��l�l�n�G��B�"�>�>�+���g�
��,�!�2�r�2�w�6�D�J�J�t��0Drc�H�ddl}|j}|j|||�Sr|)�__main__�__dict__r)rr,r��dicts    rrzProfile.run�s#���� � ���{�{�3��d�+�+rc���|j|�tj|j�	t	|||�tjd�|S#tjd�wxYwr	)rx�sys�
setprofiler3�exec)rr,rrs    rrzProfile.runctx�sP�����S�����t���'�	!���g�v�&��N�N�4� ����
�N�N�4� �s�
A�A-c���|jt|��tj|j�	||i|��tjd�S#tjd�wxYwr	)rxr�r�r�r3)rr��args�kws    r�runcallzProfile.runcall�sM�����T�$�Z� ����t���'�	!���$��$��N�N�4� ��C�N�N�4� �s�A�A/c��|jturtd��|j}d|_	|j	||�||_S#||_wxYw)Nz&Subclasses must override .calibrate().r)�	__class__rr7r.�_calibrate_inner)r�m�verbose�
saved_biass    r�	calibratezProfile.calibrate�sN���>�>��(��D�E�E��Y�Y�
���	�	#��(�(��G�4�"�D�I��
�D�I�s�A�	Ac�<�|j}d�}|fd�}||�|�}||�|�}||z
}|rtd|�t�}	|�}|	jdt	�t��|�}||z
}
|rtd|
�d}d}|	jj�D]\\}
}}\}}}}}|dvs�||z
}||z
}� |rtd|�td	|�||d
zk7rtd|z��||z
dz|z}|rtd
|�|S)Nc�(�t|�D]}d}�yrK��range)�n�i�xs   r�f1z$Profile._calibrate_inner.<locals>.f1�s���1�X����rc�4�t|�D]
}|d��y)N�dr�)r�r�r�s   rr�z#Profile._calibrate_inner.<locals>.f�s���1�X���3��rz elapsed time without profiling =zf(m)zelapsed time with profiling =g)r�r�z!'CPU seconds' profiler reported =ztotal # calls =r<z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r1�printrrrrr*r��
ValueError)rr�r�r1r�r��t0�t1�elapsed_noprofile�p�elapsed_profile�total_calls�
reported_timerr~�funcnamer`rarbrcrd�means                      rr�zProfile._calibrate_inner�sN���=�=��	��	�	
�!���Z��	�!��
�Z����G����4�6G�H�

�I��
�Z��	������F�H�-�
�Z���r�'����1�?�C����
��	�	���!�
B�&�X�t�X�(A��R��R���;�&��r�!����#�
�"�
��5�}�E��#�[�1��!�a�%���?�+�M�N�N�� 1�1�S�8�;�F����?��F��r)NN)rw)r)rrrr.r
r5r2rHr6rSrergrLr?rxr�rYr9r�rrr�r�rrr�r�r�rrrrrhs���$�L
�D�#'�N
%�$
!�
&�
$�&��,	�#�N$�-�'�'�,�)�

�H�  �
H�H� � �
.� � �
(�
�7�,�
�!�b	#�<rrc���ddl}ddlm}d}||��}d|_|j	dddd	d�
�|j	ddd
dd��|j	ddddd�
�t
jdds%|j�tjd�|j�\}}|t
jdd|j�*|jj|j�|_
t|�dkD�r|jrddl}d}|j |dd�}n�|d}	t
jj#d|jj%|	��t'j(|	�5}
t+|
j-�|	d�}ddd�t.j0j3dd|	��}||j4|j6ddd�}	t9|d|j|j:�|S|j�|S#1swY�xYw#t<$r5}dt
_tj|j@�Yd}~|Sd}~wwxYw)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrwr<r%z(run_module(modname, run_name='__main__'))�
run_module�modnamer�r�)r�loader�origin)�__spec__�__file__r�__package__�
__cached__)!�os�optparser��allow_interspersed_args�
add_optionr��argv�print_usage�exit�
parse_argsr��path�abspathr4r��runpyr��insert�dirname�io�	open_code�compile�read�	importlib�	machinery�
ModuleSpecr�rrr�BrokenPipeError�stdout�errno)
r�r�r��parser�optionsr�r�r��globs�progname�fp�spec�excs
             r�mainr�*s��
�%�[�E�
��
&�F�%*�F�"�
���d�K�i�
&���6�
���d��,�
(�%��9�
���d�H�6�
N�����8�8�A�B�<�����������'�'�)�O�W�d��C�H�H�Q�K����"��'�'�/�/�'�/�/�:���
�4�y�1�}��>�>��=�D�#�.�.���7��E�
�A�w�H��H�H�O�O�A�r�w�w���x�8�9����h�'�2��r�w�w�y�(�F�;��(��&�&�1�1�z�$�9A�2�C�D�!� �K�K� �I�I�#�"��E�	 ��4���g�o�o�w�|�|�D��M�	�����M�'(�'���	 ��C�J��H�H�S�Y�Y����M��
	 �s$�:H�#H �H� 	I�)*I�Ir�rv)
�importlib.machineryr�r�r�r/r��__all__rrrrr�rrrr�<module>rs]��'�$�	�
���
&��#�#�N:�N�~�~�D9�x�z���F�r

?>