o
p̦i @ s d Z g dZddlZddlZddlZdddZdddZejj e_ ejj e_ G d d
d
ejZ dd Z
d
d Zedkr@e dS dS )zUPython interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
)runrunctxProfile Nc C s t t| ||S N)
_pyprofile_Utilsr r ) statementfilenamesort r /usr/lib/python3.10/cProfile.pyr s r c C s t t| ||||S r )r r r r )r globalslocalsr
r r r r
r s r c @ sZ e Zd ZdZdddZdd 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 )pstatsStats
strip_dirs
sort_statsprint_stats)selfr r r r r
r ) s zProfile.print_statsc C sN dd l }t|d}| || j| W d d S 1 s w Y d S )Nr wb)marshalopencreate_statsdumpstats)r filer fr r r
dump_stats- s
"zProfile.dump_statsc C s | | d S r )disablesnapshot_statsr r r r
r 3 s zProfile.create_statsc
C s$ | }i | _i }|D ](}t|j}|j}||j }|j}|j}i } | |t|j<