summaryrefslogtreecommitdiffstats
path: root/Doc/library/profile.rst
diff options
context:
space:
mode:
authorSanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>2017-11-08 10:50:56 (GMT)
committerAntoine Pitrou <pitrou@free.fr>2017-11-08 10:50:56 (GMT)
commit7973e279a21999f134aff92dd6d344ec4591fae9 (patch)
treef8007dd3dac2f7cbf905f45ccd148cf4b5a1fd9a /Doc/library/profile.rst
parent4fc4defd1c9bd667635ba4080404e7aa3fcd49ea (diff)
downloadcpython-7973e279a21999f134aff92dd6d344ec4591fae9.zip
cpython-7973e279a21999f134aff92dd6d344ec4591fae9.tar.gz
cpython-7973e279a21999f134aff92dd6d344ec4591fae9.tar.bz2
bpo-21862: Add -m option to cProfile for profiling modules (#4297)
* bpo-21862: Add -m option to cProfile for profiling modules
Diffstat (limited to 'Doc/library/profile.rst')
-rw-r--r--Doc/library/profile.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index 68f24ab..48426a0 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -123,13 +123,18 @@ them in various ways.
The file :mod:`cProfile` can also be invoked as a script to profile another
script. For example::
- python -m cProfile [-o output_file] [-s sort_order] myscript.py
+ python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)
``-o`` writes the profile results to a file instead of to stdout
``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to sort
the output by. This only applies when ``-o`` is not supplied.
+``-m`` specifies that a module is being profiled instead of a script.
+
+ .. versionadded:: 3.7
+ Added the ``-m`` option.
+
The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of methods
for manipulating and printing the data saved into a profile results file::