FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-142646: Update Tachyon to use backtick formatting in CLI help by savannahostrowski · Pull Request #142647 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
28 changes: 12 additions & 16 deletions Lib/profiling/sampling/cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,20 @@ class CustomFormatter(

_HELP_DESCRIPTION = """Sample a process's stack frames and generate profiling data.

Commands:

savannahostrowski Dec 12, 2025 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I found this pretty redundant given that we have the same info in positional args. I can revert if someone disagrees?

Before:

After:

run Run and profile a script or module
attach Attach to and profile a running process

Examples:
# Run and profile a script
python -m profiling.sampling run script.py arg1 arg2
`python -m profiling.sampling run script.py arg1 arg2`

# Attach to a running process
python -m profiling.sampling attach 1234
`python -m profiling.sampling attach 1234`

# Live interactive mode for a script
python -m profiling.sampling run --live script.py
`python -m profiling.sampling run --live script.py`

# Live interactive mode for a running process
python -m profiling.sampling attach --live 1234
`python -m profiling.sampling attach --live 1234`

Use 'python -m profiling.sampling <command> --help' for command-specific help."""
Use `python -m profiling.sampling <command> --help` for command-specific help."""


# Constants for socket synchronization
Expand Down Expand Up @@ -506,19 +502,19 @@ def main():

Examples:
# Run and profile a module
python -m profiling.sampling run -m mymodule arg1 arg2
`python -m profiling.sampling run -m mymodule arg1 arg2`

# Generate flamegraph from a script
python -m profiling.sampling run --flamegraph -o output.html script.py
`python -m profiling.sampling run --flamegraph -o output.html script.py`

# Profile with custom interval and duration
python -m profiling.sampling run -i 50 -d 30 script.py
`python -m profiling.sampling run -i 50 -d 30 script.py`

# Save collapsed stacks to file
python -m profiling.sampling run --collapsed -o stacks.txt script.py
`python -m profiling.sampling run --collapsed -o stacks.txt script.py`

# Live interactive mode for a script
python -m profiling.sampling run --live script.py""",
`python -m profiling.sampling run --live script.py`""",
)
run_parser.add_argument(
"-m",
Expand Down Expand Up @@ -554,10 +550,10 @@ def main():

Examples:
# Profile all threads, sort by total time
python -m profiling.sampling attach -a --sort tottime 1234
`python -m profiling.sampling attach -a --sort tottime 1234`

# Live interactive mode for a running process
python -m profiling.sampling attach --live 1234""",
`python -m profiling.sampling attach --live 1234`""",
)
attach_parser.add_argument(
"pid",
Expand Down
Loading

Back | FazBrowse Home | New Git URL