\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZmZddlZddlmZddlmZmZm Z m Z m Z dZ ej dZej dZej d Zd efd YZdS( i(tabsolute_importtprint_functionNi(t_(tencodingterrort extensionstpycompattutilcC@sX|}tj|d|gytj|}Wntk rCdSXt|ddSdS(sBload profiler extension. return profile method, or None on failuret whitelisttprofileN(RtloadalltfindtKeyErrortNonetgetattr(tuitprofilertextnametmod((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt _loadprofilers c c@sj|jdd}|jdd}|jdd}|jdd}|dkrt|jtd|d}nyd d lm}Wn&tk rtjtd nX|j }|j d t z dVWd|j |dkrd d lm }|j|} | j|nG|j|j} | jtj|| jd|d|d|XdS(Nt profilingtformattsorttlimittnestedttextt kcachegrinds-unrecognized profiling format '%s' - Ignored i(tlsprofsYlsprof not available - install from http://codespeak.net/svn/user/arigo/hack/misc/lsprof/tsubcalls(tlsprofcalltreetfiletclimit(RR(tconfigt configinttwarnRtRt ImportErrorRtAborttProfilertenabletTruetdisableRt KCacheGrindtoutputtStatstgetstatsRRtsysstrtpprint( RtfpRtfieldRRRtpRtcalltreetstats((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt lsprofile s2        c c@syddlm}Wn&tk r<tjtdnX|jdd}d}t}|j|d|||}t j }z|j dVWd|j |j tdt j ||j|jdtfXdS( Ni(t flamegraphsWflamegraph not available - install from https://github.com/evanhempel/python-flamegraphRtfreqg?s7Collected %d stack frames (%d unique) in %2.2f seconds.tunique(R6R$RR%RR!R R(t ProfileThreadRttimertstarttstoptjointprintt num_frames(RR0R6R7tfilter_tcollapse_recursiontthreadt start_time((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt flameprofileCs&        c c@sddlm}|jdd}|dkrS|jjdkrj|j|qjn|jtd||jddt j rdpd }|j d d d |z dVWd|j }|jdd }i|j jd6|j jd6|j jd6|j jd6|j jd6}||kr.||}n#|jtd||j j}i} d} |dkr|j| ddd} |j| dd} | jd| d| n1|dkr|j| ddd} | | deZdZedZdZdZdZdZRS(sStart profiling. Profiling is active when the context manager is active. When the context manager exits, profiling results will be written to the configured output. cC@sL||_d|_d|_t|_d|_||_t|_ t|_ dS(N( t_uiR t_outputt_fpR(t _fpdocloset _profilert_enabledtFalset_enteredt_started(tselfRtenabled((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt__init__s       cC@s#t|_|jr|jn|S(N(R(RwRuR;(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyt __enter__s   cC@s|jstjn|jr%dSt|_tjjd}d}|dkrj|j j dd}n|dkrt |j |}|dkr|j j t d|d}qn|j j dd |_y|jd krtj|_n|jr)|j j|j}t|d |_nUtjrfd tfd Y}t|_||j |_nt|_|j j|_|dk rn0|dkrt}n|dkrt}nt}||j |j|_|jjWn|jnXdS(sStart profiling. The profiling will stop at the context exit. If the profiler was already started, this has no effect.NtHGPROFRttypetlststattflames%unrecognized profiler '%s' - ignored R+tblackboxtwbtuifpcB@s#eZdZdZdZRS(cS@s ||_dS(N(Rp(RyR((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR{scS@s|jj|dS(N(Rpt write_err(RyR]((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pytwritescS@s|jjdS(N(Rptflush(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyRs(t__name__t __module__R{RR(((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyRs  (RRR( RwRtProgrammingErrorRxR(RtenvirontgetR RpR RR"RRqRtstringioRrt expandpathtopenRRatobjectRvRstferrR5RDRoRtR|t_closefp(RyRtproffntpathR((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR;sP                 cC@sd}|jdk rz|jj|||}|jdkrzd|jj}|jdd}|jjd|qzn|j |S(NRs Profile: %sRPs%%R ( R Rtt__exit__RqRrtgetvaluetreplaceRptlogR(Rytexception_typetexception_valuet tracebackt propagatetval((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyRs  cC@s,|jr(|jdk r(|jjndS(N(RsRrR tclose(Ry((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyRs( RRt__doc__R(R{R|R;RR(((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyR s   = (t __future__RRt contextlibti18nRR#RRRRRRtcontextmanagerR5RDRoRR (((s9/usr/lib64/python2.7/site-packages/mercurial/profiling.pyts ( #=