Skip to content

Commit

Permalink
Update guide.md
Browse files Browse the repository at this point in the history
Update available CLI options
  • Loading branch information
mawildoer committed Feb 12, 2025
1 parent b5a4ddf commit cec7736
Showing 1 changed file with 50 additions and 20 deletions.
70 changes: 50 additions & 20 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,69 @@ colored summary showing where most of the time was spent.

Here are the options you can use:


Usage: pyinstrument [options] scriptfile [arg] ...

Options:
--version show program's version number and exit
-h, --help show this help message and exit
--load-prev=ID instead of running a script, load a previous report
-m MODULE_NAME run library module as a script, like 'python -m
--version show program's version number and exit
-h, --help show this help message and exit
--load=FILENAME instead of running a script, load a profile session
from a pyisession file
--load-prev=IDENTIFIER
instead of running a script, load a previous profile
session as specified by an identifier
-m MODULE run library module as a script, like 'python -m
module'
--from-path (POSIX only) instead of the working directory, look
-c PROGRAM program passed in as string, like 'python -c "..."'
--from-path (POSIX only) instead of the working directory, look
for scriptfile in the PATH environment variable
-o OUTFILE, --outfile=OUTFILE
-o OUTFILE, --outfile=OUTFILE
save to <outfile>
-r RENDERER, --renderer=RENDERER
-r RENDERER, --renderer=RENDERER
how the report should be rendered. One of: 'text',
'html', 'json', 'speedscope', or python import path
to a renderer class
-t, --timeline render as a timeline - preserve ordering and don't
'html', 'json', 'speedscope', 'pstats', or python
import path to a renderer class. Defaults to the
appropriate format for the extension if OUTFILE is
given, otherwise, defaults to 'text'.
-p RENDER_OPTION, --render-option=RENDER_OPTION
options to pass to the renderer, in the format
'flag_name' or 'option_name=option_value'. For
example, to set the option 'time', pass '-p
time=percent_of_total'. To pass multiple options, use
the -p option multiple times. You can set processor
options using dot-syntax, like '-p
processor_options.filter_threshold=0'. option_value is
parsed as a JSON value or a string.
-t, --timeline render as a timeline - preserve ordering and don't
condense repeated calls
--hide=EXPR glob-style pattern matching the file paths whose
frames to hide. Defaults to '*/lib/*'.
--hide-regex=REGEX regex matching the file paths whose frames to hide.
--hide=EXPR glob-style pattern matching the file paths whose
frames to hide. Defaults to hiding non-application
code
--hide-regex=REGEX regex matching the file paths whose frames to hide.
Useful if --hide doesn't give enough control.
--show=EXPR glob-style pattern matching the file paths whose
--show=EXPR glob-style pattern matching the file paths whose
frames to show, regardless of --hide or --hide-regex.
For example, use --show '*/<library>/*' to show frames
within a library that would otherwise be hidden.
--show-regex=REGEX regex matching the file paths whose frames to always
--show-regex=REGEX regex matching the file paths whose frames to always
show. Useful if --show doesn't give enough control.
--show-all show everything
--unicode (text renderer only) force unicode text output
--no-unicode (text renderer only) force ascii text output
--color (text renderer only) force ansi color text output
--no-color (text renderer only) force no color text output
--show-all show everything
--unicode (text renderer only) force unicode text output
--no-unicode (text renderer only) force ascii text output
--color (text renderer only) force ansi color text output
--no-color (text renderer only) force no color text output
-i INTERVAL, --interval=INTERVAL
Minimum time, in seconds, between each stack sample.
Smaller values allow resolving shorter duration
function calls but conversely incur a greater runtime
and memory consumption overhead. For longer running
scripts, setting a larger interval can help control
the rate at which the memory required to store the
stack samples increases.
--use-timing-thread Use a separate thread to time the interval between
stack samples. This can reduce the overhead of
sampling on some systems.


**Protip:** `-r html` will give you a interactive profile report as HTML - you
can really explore this way!
Expand Down

0 comments on commit cec7736

Please sign in to comment.