ó x”þfc@szdZddlZddlZddlZddlZddlZdZdZd„Zd„Z e dkrve ƒndS(s+Transform gprof(1) output into useful HTML.iÿÿÿÿNsF gprof output (%s)
s
ccs#x|D]}tj|ƒVqWdS(N(tcgitescape(tinputtline((s0/usr/lib64/python2.7/Tools/scripts/gprof2html.pyt add_escapess c Cs­d}tjdr#tjd}n|d}tt|ƒƒ}t|dƒ}|jt|ƒx.|D]&}|j|ƒ|jdƒrfPqfqfWi}xv|D]n}tjd|ƒ}|sÌ|j|ƒPn|j ddƒ\}}|||<|jd||||fƒqWx.|D]&}|j|ƒ|jd ƒrPqqWxØ|D]Ð}tjd |ƒ}|s‹|j|ƒ|jd ƒrGPqGqGn|j ddd ƒ\} }} ||krÈ|j|ƒqGn|jd ƒrú|jd| |||| fƒqG|jd| ||| fƒqGWxW|D]O}xFtj d|ƒD]2} | |kr`d| | f} n|j| ƒq;Wq"W|jt ƒ|j ƒt jdtjj|ƒƒdS(Ns gprof.outis.htmltws times (.* )(\w+)\nis+%s%s s index % times*(.* )(\w+)(( <cycle.*>)? \[\d+\])\nsIndex by function nameit[s-%s%s%s s%s%s%s s(\w+(?:\.c)?|\W+)s%ssfile:(tsystargvRtfiletwritetheadert startswithtretmatchtgrouptfindallttrailertcloset webbrowsertopentostpathtabspath( tfilenametoutputfilenameRtoutputRtlabelstmtstufftfnametprefixtsuffixtpart((s0/usr/lib64/python2.7/Tools/scripts/gprof2html.pytmainsb                    t__main__( t__doc__R RRRRR RRR"t__name__(((s0/usr/lib64/python2.7/Tools/scripts/gprof2html.pyts<   4