a �DOg��@s|gd�ZddlZddlZddlZddd�Zddd�Zejje_ejje_Gdd �d ej�Z d d �Z d d �Z e dkrxe �dS))�run�runctx�Profile�N�����cCst�t��|||�S�N)� _pyprofile�_Utilsrr)� statement�filename�sort�r � /usr/lib64/python3.9/cProfile.pyrsrcCst�t��|||||�Sr)rrrr)r �globals�localsr r r r r rs�rc@sVeZdZddd�Zdd�Zdd�Zdd �Zd d �Zd d �Zdd�Z dd�Z dd�Z dS)rrcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ strip_dirsZ sort_stats� print_stats)�selfr rr r r r)szProfile.print_statscCsLddl}t|d��&}|��|�|j|�Wd�n1s>0YdS)Nr�wb)�marshal�open� create_stats�dump�stats)r�filer�fr r r � dump_stats-s zProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rr r r r3szProfile.create_statsc Cs*|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i} | |t|j�<||||| f|j|<q|D]�}|j rlt|j�}|j D]�} z|t| j�} Wnt y�Yq�Yn0| j}|| j}| j}| j}|| v�r| |} || d7}|| d7}|| d7}|| d7}||||f| |<q�qldS)Nr���) Zgetstatsr�label�codeZ callcountZ reccallcountZ inlinetimeZ totaltime�idZcalls�KeyError) r�entriesZ callersdicts�entry�funcZncZcc�tt�ctZcallersZsubentry�prevr r r r7s>            zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr.�dictr r r r]sz Profile.runcCs0|��zt|||�W|��n |��0|Sr)�enable�execr)rr0rrr r r rbs zProfile.runctxcOs0|��z||i|��W|��S|��0dSr)r2r)rr*�args�kwr r r �runcallks �zProfile.runcallcCs |��|Sr)r2r r r r � __enter__rszProfile.__enter__cGs |��dSr)r)r�exc_infor r r �__exit__vszProfile.__exit__N)r) �__name__� __module__� __qualname__rrrrrrr6r7r9r r r r rs & rcCs(t|t�rdd|fS|j|j|jfSdS)N�~r)� isinstance�str� co_filename�co_firstlineno�co_name)r%r r r r${s  r$c Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd dd �|jd d d ddt|j j �d�|jdddddd�|j dd�s�|� �|� d�|��\}}||j dd�<|jdur�|j�|j�|_t|�dk�r�|j�rd} |j|dd�} nh|d} |j�d|j�| ��t�| �� } t| ��| d�} Wd�n1�sV0Y| dddd�} zt| | d|j|j�Wn8t�y�} zd|_|� | j�WYd} ~ n d} ~ 00n|� �|S)Nr)� OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz --outfile�outfilezSave stats to )�dest�help�defaultz-sz--sortr z?Sort order when printing to stdout, based on pstats.Stats classr)rFrGrH�choicesz-m�module� store_truezProfile a library module)rF�actionrGrHr!r"z(run_module(modname, run_name='__main__'))� run_module�modnamer3r.)�__file__r:� __package__� __cached__) �os�sys�runpyrZoptparserCZallow_interspersed_argsZ add_option�sortedrZsort_arg_dict_default�argv� print_usage�exit� parse_argsrE�path�abspath�lenrJrM�insert�dirname�io� open_code�compile�readrr �BrokenPipeError�stdout�errno)rRrSrTrrCrD�parser�optionsr4r%ZglobsZprogname�fp�excr r r �main�s`   �  � �   � 0�$rjr.)Nr)Nr) �__all__Z_lsprofr_Zprofilerrr�__doc__ZProfilerrr$rjr:r r r r �s    _;