Skip to content

Commit 421939f

Browse files
committed
fixup! fixup! fixup! fixup! gh-138709: Implement CPU time profiling in profiling.sample
1 parent ea7b98c commit 421939f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/profiling/sampling/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def sample(
611611
collector = CollapsedStackCollector(skip_idle=skip_idle)
612612
filename = filename or f"collapsed.{pid}.txt"
613613
case "flamegraph":
614-
collector = FlamegraphCollector()
614+
collector = FlamegraphCollector(skip_idle=skip_idle)
615615
filename = filename or f"flamegraph.{pid}.html"
616616
case _:
617617
raise ValueError(f"Invalid output format: {output_format}")

Lib/profiling/sampling/stack_collector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def export(self, filename):
5050

5151

5252
class FlamegraphCollector(StackTraceCollector):
53-
def __init__(self):
54-
super().__init__()
53+
def __init__(self, *args, **kwargs):
54+
super().__init__(*args, **kwargs)
5555
self.stats = {}
5656

5757
def set_stats(self, sample_interval_usec, duration_sec, sample_rate, error_rate=None):

0 commit comments

Comments
 (0)