7ec@szdZddlZddlZddlZddlZddlZdZdZdZdZ e dkrve ndS(s+Transform gprof(1) output into useful HTML.iNsF gprof output (%s)
s
ccs#x|D]}tj|VqWdS(N(tcgitescape(tinputtline((s0/usr/lib64/python2.7/Tools/scripts/gprof2html.pyt add_escapess c Csd}tjdr#tjd}n|d}tt|}t|d}|jt|x.|D]&}|j||jdrfPqfqfWi}xv|D]n}tjd|}|s|j|Pn|j dd\}}|||<|jd||||fqWx.|D]&}|j||jd rPqqWx|D]}tjd |}|s|j||jd rGPqGqGn|j ddd \} }} ||kr|j|qGn|jd r|jd| |||| fqG|jd| ||| fqGWxW|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