e f @ s d Z d d d g Z d d l Z d d l Z d d d d Z d d d d Z e j j e _ e j j e _ Gd d d e j Z d d Z d d Z e d k r e n d S)zUPython interface for the 'lsprof' profiler. Compatible with the 'profile' module. runrunctxProfile N c C s t j t j | | | S)N) _pyprofile_Utilsr r ) statementfilenamesort r -/opt/alt/python34/lib64/python3.4/cProfile.pyr s c C s" t j t j | | | | | S)N)r r r r )r globalslocalsr r r r r r s c @ sm e Z d Z d Z d d d Z d d Z d d Z d d Z d d Z d d Z d d Z d S)r ai Profile(custom_timer=None, time_unit=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, time_unit can be a float specifying a scale (i.e. how long each integer unit is, in seconds). r c C s2 d d l } | j | j j | j d S)Nr )pstatsZStatsZ strip_dirsZ sort_statsprint_stats)selfr r r r r r ( s zProfile.print_statsc C sE d d l } t | d $ } | j | j | j | Wd QXd S)Nr wb)marshalopencreate_statsdumpstats)r filer fr r r dump_stats, s zProfile.dump_statsc C s | j | j d S)N)disablesnapshot_stats)r r r r r 2 s zProfile.create_statsc C s | j } i | _ i } xz | D]r } t | j } | j } | | j } | j } | j } i } | | t | j <| | | | | f | j |