6 if isinstance(code, str):
9 return '%s %s:%d' % (code.co_name, code.co_filename, code.co_firstlineno)
15 self.
data = profiler.getstats()
20 print_(
'events: Ticks', file=out_file)
22 for entry
in self.
data:
27 for entry
in self.
data:
28 totaltime =
int(entry.totaltime * 1000)
29 max_cost =
max(max_cost, totaltime)
30 print_(
'summary: %d' % (max_cost,), file=self.
out_file)
35 inlinetime =
int(entry.inlinetime * 1000)
37 if isinstance(code, str):
38 print_(
'fi=~', file=out_file)
40 print_(
'fi=%s' % (code.co_filename,), file=out_file)
41 print_(
'fn=%s' % (
label(code),), file=out_file)
42 if isinstance(code, str):
43 print_(
'0 ', inlinetime, file=out_file)
45 print_(
'%d %d' % (code.co_firstlineno, inlinetime), file=out_file)
51 if isinstance(code, str):
54 lineno = code.co_firstlineno
55 for subentry
in calls:
62 totaltime =
int(subentry.totaltime * 1000)
64 print_(
'cfn=%s' % (
label(code),), file=out_file)
65 if isinstance(code, str):
66 print_(
'cfi=~', file=out_file)
67 print_(
'calls=%d 0' % (subentry.callcount,), file=out_file)
69 print_(
'cfi=%s' % (code.co_filename,), file=out_file)
70 print_(
'calls=%d %d' % (
71 subentry.callcount, code.co_firstlineno), file=out_file)
72 print_(
'%d %d' % (lineno, totaltime), file=out_file)