Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement GIL mode and filtering
  • Loading branch information
pablogsal committed Sep 15, 2025
commit ad433347113b1411075c335f510857b357fe9825
18 changes: 9 additions & 9 deletions Lib/test/test_profiling/test_sampling_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ def test_cli_module_argument_parsing(self):
show_summary=True,
output_format="pstats",
realtime_stats=False,
skip_idle=False
mode=0
)

@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
Expand Down Expand Up @@ -2024,7 +2024,7 @@ def test_cli_module_with_arguments(self):
show_summary=True,
output_format="pstats",
realtime_stats=False,
skip_idle=False
mode=0
)

@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
Expand Down Expand Up @@ -2052,7 +2052,7 @@ def test_cli_script_argument_parsing(self):
show_summary=True,
output_format="pstats",
realtime_stats=False,
skip_idle=False
mode=0
)

@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
Expand Down Expand Up @@ -2152,7 +2152,7 @@ def test_cli_module_with_profiler_options(self):
show_summary=True,
output_format="pstats",
realtime_stats=False,
skip_idle=False
mode=0
)

@unittest.skipIf(is_emscripten, "socket.SO_REUSEADDR does not exist")
Expand Down Expand Up @@ -2186,7 +2186,7 @@ def test_cli_script_with_profiler_options(self):
show_summary=True,
output_format="collapsed",
realtime_stats=False,
skip_idle=False
mode=0
)

def test_cli_empty_module_name(self):
Expand Down Expand Up @@ -2398,7 +2398,7 @@ def test_argument_parsing_basic(self):
show_summary=True,
output_format="pstats",
realtime_stats=False,
skip_idle=False
mode=0
)

def test_sort_options(self):
Expand Down Expand Up @@ -2526,7 +2526,7 @@ def main():
proc.pid,
duration_sec=0.5,
sample_interval_usec=5000,
skip_idle=True, # CPU mode
mode=1, # CPU mode
show_summary=False,
all_threads=True,
)
Expand All @@ -2535,7 +2535,7 @@ def main():

cpu_mode_output = captured_output.getvalue()

# Test wall-clock mode (skip_idle=False) - should capture both functions
# Test wall-clock mode (mode=0) - should capture both functions
with (
io.StringIO() as captured_output,
mock.patch("sys.stdout", captured_output),
Expand All @@ -2545,7 +2545,7 @@ def main():
proc.pid,
duration_sec=0.5,
sample_interval_usec=5000,
skip_idle=False, # Wall-clock mode
mode=0, # Wall-clock mode
show_summary=False,
all_threads=True,
)
Expand Down