◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
13 changes: 8 additions & 5 deletions Doc/library/profiling.sampling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,9 @@ interesting functions that highlights:

Use :option:`--no-summary` to suppress both the legend and summary sections.

To save pstats output to a file instead of stdout::

python -m profiling.sampling run -o profile.txt script.py

The pstats format supports several options for controlling the display.
The :option:`--sort` option determines the column used for ordering results::
Expand Down Expand Up @@ -1455,7 +1455,9 @@ Output options

.. option:: --pstats

Generate text statistics output. This is the default.

.. option:: --collapsed

Expand Down Expand Up @@ -1486,8 +1488,9 @@ Output options
.. option:: -o <path>, --output <path>

Output file or directory path. Default behavior varies by format:
:option:`--pstats` writes to stdout, while other formats generate a file
named ``<format>_<PID>.<ext>`` (for example, ``flamegraph_12345.html``).
:option:`--heatmap` creates a directory named ``heatmap_<PID>``.

.. option:: --browser
4 changes: 2 additions & 2 deletions Lib/profiling/sampling/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ def _add_format_options(parser, include_compression=True, include_binary=True):
"-o",
"--output",
dest="outfile",
help="Output path (default: stdout for pstats, auto-generated for others). "
"For heatmap: directory name (default: heatmap_PID)",
)
output_group.add_argument(
"--browser",
Expand Down
Loading
Toggle all file notes Toggle all file annotations