Skip to content

Instantly share code, notes, and snippets.

@jvns
Last active January 2, 2023 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jvns/6deaa10500f375a8581a06da8d8a967b to your computer and use it in GitHub Desktop.
Save jvns/6deaa10500f375a8581a06da8d8a967b to your computer and use it in GitHub Desktop.
usage: pprof [options] [binary] <profile source> ...
Output format (only set one):
-callgrind Outputs a graph in callgrind format
-disasm=p Output annotated assembly for functions matching regexp or address
-dot Outputs a graph in DOT format
-eog Visualize graph through eog
-evince Visualize graph through evince
-gif Outputs a graph image in GIF format
-gv Visualize graph through gv
-list=p Output annotated source for functions matching regexp
-pdf Outputs a graph in PDF format
-peek=p Output callers/callees of functions matching regexp
-png Outputs a graph image in PNG format
-proto Outputs the profile in compressed protobuf format
-ps Outputs a graph in PS format
-raw Outputs a text representation of the raw profile
-svg Outputs a graph in SVG format
-tags Outputs all tags in the profile
-text Outputs top entries in text form
-top Outputs top entries in text form
-tree Outputs a text rendering of call graph
-web Visualize graph through web browser
-weblist=p Output annotated source in HTML for functions matching regexp or address
Output file parameters (for file-based output formats):
-output=f Generate output on file f (stdout by default)
Output granularity (only set one):
-functions Report at function level [default]
-files Report at source file level
-lines Report at source line level
-addresses Report at address level
Comparison options:
-base <profile> Show delta from this profile
-drop_negative Ignore negative differences
Sorting options:
-cum Sort by cumulative data
Dynamic profile options:
-seconds=N Length of time for dynamic profiles
Profile trimming options:
-nodecount=N Max number of nodes to show
-nodefraction=f Hide nodes below <f>*total
-edgefraction=f Hide edges below <f>*total
Sample value selection option (by index):
-sample_index Index of sample value to display
-mean Average sample value over first value
Sample value selection option (for heap profiles):
-inuse_space Display in-use memory size
-inuse_objects Display in-use object counts
-alloc_space Display allocated memory size
-alloc_objects Display allocated object counts
Sample value selection option (for contention profiles):
-total_delay Display total delay at each region
-contentions Display number of delays at each region
-mean_delay Display mean delay at each region
Filtering options:
-runtime Show runtime call frames in memory profiles
-focus=r Restricts to paths going through a node matching regexp
-ignore=r Skips paths going through any nodes matching regexp
-tagfocus=r Restrict to samples tagged with key:value matching regexp
Restrict to samples with numeric tags in range (eg "32kb:1mb")
-tagignore=r Discard samples tagged with key:value matching regexp
Avoid samples with numeric tags in range (eg "1mb:")
Miscellaneous:
-call_tree Generate a context-sensitive call tree
-unit=u Convert all samples to unit u for display
-divide_by=f Scale all samples by dividing them by f
-buildid=id Override build id for main binary in profile
-tools=path Search path for object-level tools
-help This message
Environment Variables:
PPROF_TMPDIR Location for saved profiles (default $HOME/pprof)
PPROF_TOOLS Search path for object-level tools
PPROF_BINARY_PATH Search path for local binary files
default: $HOME/pprof/binaries
finds binaries by $name and $buildid/$name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment