관리-도구
편집 파일: cProfile.cpython-39.pyc
a �����DOg�����������������������@���s����d�Z�g�d�ZddlZddlZddlZddd�Zddd�Zejj�e_�ejj�e_�G�d d ��d ej�Z dd��Z d d��Zedkr|e���dS�)zUPython interface for the 'lsprof' profiler. Compatible with the 'profile' module. )�run�runctx�Profile�����N���c�����������������C���s���t��t��|�||�S��N)� _pyprofile�_Utilsr���r���)� statement�filename�sort��r���� /usr/lib64/python3.9/cProfile.pyr������s����r���c�����������������C���s���t��t��|�||||�S�r���)r���r���r���r���)r ����globals�localsr ���r���r���r���r ���r������s�����r���c�������������������@���sZ���e�Zd�ZdZddd�Zdd��Zdd��Zd d ��Zdd��Zd d��Z dd��Z dd��Zdd��ZdS�)r���a`��Profile(timer=None, timeunit=None, subcalls=True, builtins=True) Builds a profiler object using the specified timer function. The default timer is a fast built-in one based on real time. For custom timer functions returning integers, timeunit can be a float specifying a scale (i.e. how long each integer unit is, in seconds). r���c�����������������C���s$���dd�l�}|�|������|�����d�S��Nr���)�pstats�StatsZ strip_dirsZ sort_stats�print_stats)�selfr���r���r���r���r ���r���)���s����zProfile.print_statsc�����������������C���sL���dd�l�}t|d��&}|�����|�|�j|��W�d�����n1�s>0����Y��d�S�)Nr����wb)�marshal�open�create_stats�dump�stats)r����filer����fr���r���r ���� dump_stats-���s����zProfile.dump_statsc�����������������C���s���|������|�����d�S�r���)�disable�snapshot_stats�r���r���r���r ���r���3���s����zProfile.create_statsc�������������� ���C���s*��|�����}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��} W�n�t y����Y�q�Y�n0�| j}|| j�}| j}| j}|| v��r| |�}||d�7�}||d�7�}||d�7�}||d�7�}||||f| |<�q�qld�S�)Nr���������������)Zgetstatsr����label�codeZ callcountZreccallcountZ inlinetimeZ totaltime�idZcalls�KeyError)r����entriesZcallersdicts�entry�funcZncZcc�tt�ctZcallersZsubentry�prevr���r���r ���r���7���s>���� zProfile.snapshot_statsc�����������������C���s���dd�l�}|j}|��|||�S�r���)�__main__�__dict__r���)r����cmdr.����dictr���r���r ���r���]���s����zProfile.runc�����������������C���s0���|������zt|||��W�|�����n |�����0�|�S�r���)�enable�execr���)r���r0���r���r���r���r���r ���r���b���s ����zProfile.runctxc����������������O���s0���|������z||i�|��W�|�����S�|�����0�d�S�r���)r2���r���)r���r*����args�kwr���r���r ����runcallk���s�����zProfile.runcallc�����������������C���s���|������|�S�r���)r2���r ���r���r���r ���� __enter__r���s����zProfile.__enter__c�����������������G���s���|������d�S�r���)r���)r����exc_infor���r���r ����__exit__v���s����zProfile.__exit__N)r���) �__name__� __module__�__qualname__�__doc__r���r���r���r���r���r���r6���r7���r9���r���r���r���r ���r������s��� & r���c�����������������C���s(���t�|�t�rdd|�fS�|�j|�j|�jfS�d�S�)N�~r���)� isinstance�str�co_filename�co_firstlineno�co_name)r%���r���r���r ���r$���{���s���� r$���c��������������� ���C���s���dd�l�}�dd�l}dd�l}dd�l}ddlm}�d}||d�}d|_|jdddd d�d ��|jddd ddt|j j �d��|jdddddd��|jdd���s�|����|� d��|���\}}||jd�d��<�|jd�ur�|�j�|j�|_t|�dk�r�|j�rd} |j|d�d�} nh|d�}|j�d|�j�|���t�|�� }t|���|d�} W�d�����n1��sV0����Y��|dd�d�d�} zt| | d�|j|j��W�n8�t�y��} �zd�|_|� | j��W�Y�d�} ~ n d�} ~ 0�0�n|����|S�)Nr���)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz --outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortr���z?Sort order when printing to stdout, based on pstats.Stats classr���)rG���rH���rI����choicesz-m�module� store_truezProfile a library module)rG����actionrH���rI���r!���r"���z(run_module(modname, run_name='__main__'))� run_module�modnamer3���r.���)�__file__r:����__package__� __cached__) �os�sys�runpyr���ZoptparserD���Zallow_interspersed_argsZ add_option�sortedr���Zsort_arg_dict_default�argv�print_usage�exit� parse_argsrF����path�abspath�lenrK���rN����insert�dirname�io� open_code�compile�readr���r����BrokenPipeError�stdout�errno)rS���rT���rU���r���rD���rE����parser�optionsr4���r%���ZglobsZprogname�fp�excr���r���r ����main����s`���� � � � �0�$rk���r.���)Nr���)Nr���) r=����__all__Z_lsprofr`���Zprofiler���r���r���ZProfilerr���r$���rk���r:���r���r���r���r ����<module>���s��� _;