##// END OF EJS Templates
statprof: fix overflow while skipping boilerplate parts...
Yuya Nishihara -
r40421:cc458674 default
parent child Browse files
Show More
@@ -257,6 +257,9 b' class CodeSite(object):'
257 def filename(self):
257 def filename(self):
258 return os.path.basename(self.path)
258 return os.path.basename(self.path)
259
259
260 def skipname(self):
261 return r'%s:%s' % (self.filename(), self.function)
262
260 class Sample(object):
263 class Sample(object):
261 __slots__ = (u'stack', u'time')
264 __slots__ = (u'stack', u'time')
262
265
@@ -661,10 +664,8 b' def display_hotpath(data, fp, limit=0.05'
661 if len(stack) > 1:
664 if len(stack) > 1:
662 i = 1
665 i = 1
663 # Skip boiler plate parts of the stack
666 # Skip boiler plate parts of the stack
664 name = r'%s:%s' % (stack[i].filename(), stack[i].function)
667 while i < len(stack) and stack[i].skipname() in skips:
665 while i < len(stack) and name in skips:
666 i += 1
668 i += 1
667 name = r'%s:%s' % (stack[i].filename(), stack[i].function)
668 if i < len(stack):
669 if i < len(stack):
669 child.add(stack[i:], time)
670 child.add(stack[i:], time)
670
671
General Comments 0
You need to be logged in to leave comments. Login now