HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/mercurial/__pycache__/lsprofcalltree.cpython-310.pyc
o

�]Lb�
�@s8dZddlmZddlmZdd�ZGdd�de�Zd	S)
aC
lsprofcalltree.py - lsprof output which is readable by kcachegrind

Authors:
    * David Allouche <david <at> allouche.net>
    * Jp Calderone & Itamar Shtull-Trauring
    * Johan Dahlin

This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
�)�absolute_import�)�pycompatcCs8t|t�rdt�|�Sdt�|j�t�|j�|jfS)N�~s%s %s:%d)�
isinstance�strr�sysbytes�co_name�co_filename�co_firstlineno)�code�r
�:/usr/lib/python3/dist-packages/mercurial/lsprofcalltree.py�labels


�rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�KCacheGrindcCs|��|_d|_dS)N)�getstats�data�out_file)�self�profilerr
r
r�__init__s

zKCacheGrind.__init__cCs2||_|�d�|��|jD]}|�|�qdS)Nsevents: Ticks
)r�write�_print_summaryr�_entry)rr�entryr
r
r�output#s

�zKCacheGrind.outputcCs<d}|jD]}t|jd�}t||�}q|j�d|�dS)Nr��ssummary: %d
)r�int�	totaltime�maxrr)r�max_costrrr
r
rr*s

zKCacheGrind._print_summarycCs�|j}|j}t|t�r|�d�n|�dt�|j��|�dt|��t	|j
d�}t|t�r9|�d|�n
|�d|j|f�|jrJ|j}ng}t|t�rTd}n|j}|D]}|�
||�qY|�d�dS)	Nsfi=~
sfi=%s
sfn=%s
rs0 %d
�%d %d
r�
)rrrrrrrr
rr�
inlinetimer�calls�	_subentry)rrrrr#r$�lineno�subentryr
r
rr1s&


zKCacheGrind._entrycCs�|j}|j}|�dt|��t|t�r"|�d�|�d|j�n|�dt�|j	��|�d|j|j
f�t|jd�}|�d||f�dS)Nscfn=%s
scfi=~
scalls=%d 0
scfi=%s
scalls=%d %d
rr!)
rrrrrr�	callcountrrr
rrr)rr&r'rrrr
r
rr%Rs

�zKCacheGrind._subentryN)�__name__�
__module__�__qualname__rrrrr%r
r
r
rrs!rN)�__doc__�
__future__r�rr�objectrr
r
r
r�<module>s