##// END OF EJS Templates
statprof: handle `lineno == None` in more cases...
Martin von Zweigbergk -
r52066:93355163 default
parent child Browse files
Show More
@@ -384,7 +384,7 b' def save_data(path):'
384 time = sample.time
384 time = sample.time
385 stack = sample.stack
385 stack = sample.stack
386 sites = [
386 sites = [
387 b'\1'.join([s.path, b'%d' % s.lineno, s.function])
387 b'\1'.join([s.path, b'%d' % s.lineno or -1, s.function])
388 for s in stack
388 for s in stack
389 ]
389 ]
390 file.write(b"%d\0%s\n" % (time, b'\0'.join(sites)))
390 file.write(b"%d\0%s\n" % (time, b'\0'.join(sites)))
@@ -663,7 +663,7 b' def display_about_method(data, fp, funct'
663 count / relevant_samples * 100,
663 count / relevant_samples * 100,
664 pycompat.fsencode(parent.filename()),
664 pycompat.fsencode(parent.filename()),
665 pycompat.sysbytes(parent.function),
665 pycompat.sysbytes(parent.function),
666 parent.lineno,
666 parent.lineno or -1,
667 pycompat.sysbytes(parent.getsource(50)),
667 pycompat.sysbytes(parent.getsource(50)),
668 )
668 )
669 )
669 )
@@ -705,7 +705,7 b' def display_about_method(data, fp, funct'
705 b' %6.2f%% line %s: %s\n'
705 b' %6.2f%% line %s: %s\n'
706 % (
706 % (
707 count / relevant_samples * 100,
707 count / relevant_samples * 100,
708 child.lineno,
708 child.lineno or -1,
709 pycompat.sysbytes(child.getsource(50)),
709 pycompat.sysbytes(child.getsource(50)),
710 )
710 )
711 )
711 )
@@ -865,7 +865,7 b' def write_to_json(data, fp):'
865 stack.append(
865 stack.append(
866 (
866 (
867 pycompat.sysstr(frame.path),
867 pycompat.sysstr(frame.path),
868 frame.lineno,
868 frame.lineno or -1,
869 pycompat.sysstr(frame.function),
869 pycompat.sysstr(frame.function),
870 )
870 )
871 )
871 )
@@ -954,7 +954,10 b' def write_to_chrome(data, fp, minthresho'
954 (
954 (
955 (
955 (
956 '%s:%d'
956 '%s:%d'
957 % (simplifypath(pycompat.sysstr(frame.path)), frame.lineno),
957 % (
958 simplifypath(pycompat.sysstr(frame.path)),
959 frame.lineno or -1,
960 ),
958 pycompat.sysstr(frame.function),
961 pycompat.sysstr(frame.function),
959 )
962 )
960 for frame in sample.stack
963 for frame in sample.stack
General Comments 0
You need to be logged in to leave comments. Login now