summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMario Corchero <mariocj89@gmail.com>2018-11-05 12:03:46 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2018-11-05 12:03:46 (GMT)
commitad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1 (patch)
tree2d5abe6b5b1f3bf01254dce0d1504930072a3d9b /Doc
parent2810dd7be9876236f74ac80716d113572c9098dd (diff)
downloadcpython-ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1.zip
cpython-ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1.tar.gz
cpython-ad1a25f499362eaf9cbfcafa0b8e2454eb43dcf1.tar.bz2
bpo-32512: Add -m option to profile for profiling modules (#5132)
The new option in the CLI of the profile module allow to profile executable modules. This change follows the same implementation as the one already present in `cProfile`. As the argument is now present on both modules, move the tests to the common test case to be run with profile as well.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/profile.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index 1a772fb..9ceb816 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -120,8 +120,8 @@ results to a file by specifying a filename to the :func:`run` function::
The :class:`pstats.Stats` class reads profile results from a file and formats
them in various ways.
-The file :mod:`cProfile` can also be invoked as a script to profile another
-script. For example::
+The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script to
+profile another script. For example::
python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)
@@ -133,7 +133,10 @@ 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.
+ Added the ``-m`` option to :mod:`cProfile`.
+
+ .. versionadded:: 3.8
+ Added the ``-m`` option to :mod:`profile`.
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::