MCPcopy Index your code
hub / github.com/python/cpython / _add_mode_options

Function _add_mode_options

Lib/profiling/sampling/cli.py:419–437  ·  view source on GitHub ↗

Add mode options to a parser.

(parser)

Source from the content-addressed store, hash-verified

417
418
419def _add_mode_options(parser):
420 """Add mode options to a parser."""
421 mode_group = parser.add_argument_group("Mode options")
422 mode_group.add_argument(
423 "--mode",
424 choices=["wall", "cpu", "gil", "exception"],
425 default="wall",
426 help="Sampling mode: wall (all samples), cpu (only samples when thread is on CPU), "
427 "gil (only samples when thread holds the GIL), "
428 "exception (only samples when thread has an active exception). "
429 "Incompatible with --async-aware",
430 )
431 mode_group.add_argument(
432 "--async-mode",
433 choices=["running", "all"],
434 default="running",
435 help='Async profiling mode: "running" (only running task) '
436 'or "all" (all tasks including waiting). Requires --async-aware',
437 )
438
439
440def _add_format_options(parser, include_compression=True, include_binary=True):

Callers 1

_mainFunction · 0.85

Calls 2

add_argument_groupMethod · 0.45
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…