File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -123,23 +123,32 @@ them in various ways.
123123
124124.. _profile-cli :
125125
126+ .. program :: cProfile 
127+ 
126128The files :mod: `cProfile ` and :mod: `profile ` can also be invoked as a script to
127129profile another script.  For example::
128130
129131   python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py) 
130132
131- ``-o `` writes the profile results to a file instead of to stdout
133+ .. option :: -o  <output_file >
134+ 
135+    Writes the profile results to a file instead of to stdout.
136+ 
137+ .. option :: -s  <sort_order >
138+ 
139+    Specifies one of the :func: `~pstats.Stats.sort_stats ` sort values
140+    to sort the output by.
141+    This only applies when :option: `-o <cProfile -o> ` is not supplied.
132142
133- ``-s `` specifies one of the :func: `~pstats.Stats.sort_stats ` sort values to sort
134- the output by. This only applies when ``-o `` is not supplied.
143+ .. option :: -m  <module >
135144
136- `` -m `` specifies  that a module is being profiled instead of a script.
145+    Specifies  that a module is being profiled instead of a script.
137146
138- .. versionadded :: 3.7 
139-    Added the ``-m `` option to :mod: `cProfile `.
147+     .. versionadded :: 3.7 
148+        Added the ``-m `` option to :mod: `cProfile `.
140149
141- .. versionadded :: 3.8 
142-    Added the ``-m `` option to :mod: `profile `.
150+     .. versionadded :: 3.8 
151+        Added the ``-m `` option to :mod: `profile `.
143152
144153The :mod: `pstats ` module's :class: `~pstats.Stats ` class has a variety of methods
145154for manipulating and printing the data saved into a profile results file::
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments