Skip to content

Commit 25e770b

Browse files
committed
Do not show artificial lines in GC frames or native
1 parent 269fe68 commit 25e770b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/profiling/sampling/stack_collector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def export(self, filename):
104104
def _format_function_name(func):
105105
filename, lineno, funcname = func
106106

107+
# Special frames like <GC> and <native> should not show file:line
108+
if filename == "~" and lineno == 0:
109+
return funcname
110+
107111
if len(filename) > 50:
108112
parts = filename.split("/")
109113
if len(parts) > 2:

0 commit comments

Comments
 (0)