î 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. ÚrunÚrunctxÚProfileé Né c C s t j t ƒ j | | | ƒ S)N)Ú _pyprofileÚ_Utilsr r )Ú statementÚfilenameÚsort© r ú-/opt/alt/python34/lib64/python3.4/cProfile.pyr s c C s" t j t ƒ j | | | | | ƒ S)N)r r r r )r ÚglobalsÚlocalsr 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_statsÚprint_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)ÚmarshalÚopenÚcreate_statsÚdumpÚstats)r Úfiler Úfr r r Ú dump_stats, s zProfile.dump_statsc C s | j ƒ | j ƒ d S)N)ÚdisableÚsnapshot_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 |