Skip to content

Commit f3ade0d

Browse files
committed
Default "native" to False
1 parent 1118285 commit f3ade0d

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

Lib/profiling/sampling/sample.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _run_with_sync(original_cmd):
136136

137137

138138
class SampleProfiler:
139-
def __init__(self, pid, sample_interval_usec, all_threads, *, mode=PROFILING_MODE_WALL, native=True, gc=True):
139+
def __init__(self, pid, sample_interval_usec, all_threads, *, mode=PROFILING_MODE_WALL, native=False, gc=True):
140140
self.pid = pid
141141
self.sample_interval_usec = sample_interval_usec
142142
self.all_threads = all_threads
@@ -613,7 +613,7 @@ def sample(
613613
output_format="pstats",
614614
realtime_stats=False,
615615
mode=PROFILING_MODE_WALL,
616-
native=True,
616+
native=False,
617617
gc=True,
618618
):
619619
profiler = SampleProfiler(
@@ -763,10 +763,9 @@ def main():
763763
help="Print real-time sampling statistics (Hz, mean, min, max, stdev) during profiling",
764764
)
765765
sampling_group.add_argument(
766-
"--no-native",
767-
action="store_false",
768-
dest="native",
769-
help="Don't include artificial \"<native>\" frames to denote calls to non-Python code.",
766+
"--native",
767+
action="store_true",
768+
help="Include artificial \"<native>\" frames to denote calls to non-Python code.",
770769
)
771770
sampling_group.add_argument(
772771
"--no-gc",

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ def test_cli_module_argument_parsing(self):
21652165
output_format="pstats",
21662166
realtime_stats=False,
21672167
mode=0,
2168-
native=True,
2168+
native=False,
21692169
gc=True,
21702170
)
21712171

@@ -2195,7 +2195,7 @@ def test_cli_module_with_arguments(self):
21952195
output_format="pstats",
21962196
realtime_stats=False,
21972197
mode=0,
2198-
native=True,
2198+
native=False,
21992199
gc=True,
22002200
)
22012201

@@ -2225,7 +2225,7 @@ def test_cli_script_argument_parsing(self):
22252225
output_format="pstats",
22262226
realtime_stats=False,
22272227
mode=0,
2228-
native=True,
2228+
native=False,
22292229
gc=True,
22302230
)
22312231

@@ -2327,7 +2327,7 @@ def test_cli_module_with_profiler_options(self):
23272327
output_format="pstats",
23282328
realtime_stats=False,
23292329
mode=0,
2330-
native=True,
2330+
native=False,
23312331
gc=True,
23322332
)
23332333

@@ -2363,7 +2363,7 @@ def test_cli_script_with_profiler_options(self):
23632363
output_format="collapsed",
23642364
realtime_stats=False,
23652365
mode=0,
2366-
native=True,
2366+
native=False,
23672367
gc=True,
23682368
)
23692369

@@ -2577,7 +2577,7 @@ def test_argument_parsing_basic(self):
25772577
output_format="pstats",
25782578
realtime_stats=False,
25792579
mode=0,
2580-
native=True,
2580+
native=False,
25812581
gc=True,
25822582
)
25832583

@@ -3067,7 +3067,7 @@ def test_gc_frames_enabled(self):
30673067
duration_sec=1,
30683068
sample_interval_usec=5000,
30693069
show_summary=False,
3070-
native=True,
3070+
native=False,
30713071
gc=True,
30723072
)
30733073
except PermissionError:
@@ -3095,7 +3095,7 @@ def test_gc_frames_disabled(self):
30953095
duration_sec=1,
30963096
sample_interval_usec=5000,
30973097
show_summary=False,
3098-
native=True,
3098+
native=False,
30993099
gc=False,
31003100
)
31013101
except PermissionError:

0 commit comments

Comments
 (0)