.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "JEPROF 1"
.TH JEPROF 1 "2019-01-12" "jemalloc 5.1.0_0" "User Manual"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
jeprof \- analyze and print jemalloc's heap profile dumps
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIprogram\fR> <\fIprofiles\fR>" 4
.IX Item "jeprof [options] <program> <profiles>"
.PD 0
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIsymbolized-profiles\fR>" 4
.IX Item "jeprof [options] <symbolized-profiles>"
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIprofile\fR>" 4
.IX Item "jeprof [options] <profile>"
.IP "\fBjeprof\fR \-\-symbols \fIprogram\fR" 4
.IX Item "jeprof --symbols program"
.PD
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
jeprof can be used to parse, analyze and generate user-readable output from
jemalloc's memory profile dumps.  Refer to \fBjemalloc\fR\|(3) or the jemalloc
website <http://jemalloc.net/> about jemalloc and the \fBopt.prof\fR option.
.PP
jeprof is based on \fBpprof\fR\|(1) that is developed as part of the
<https://github.com/gperftools/gperftools> gperftools package.
.PP
Common usage:
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIprogram\fR> <\fIprofiles\fR>" 4
.IX Item "jeprof [options] <program> <profiles>"
Interactive mode. <\fIprofiles\fR> is a space separated list of profile names.
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIsymbolized-profiles\fR>" 4
.IX Item "jeprof [options] <symbolized-profiles>"
<\fIsymbolized-profiles\fR> is a list of profile files where each file contains
the necessary symbol mappings  as well as profile data (likely generated with
\&\-\-raw).
.IP "\fBjeprof\fR [\fIoptions\fR] <\fIprofile\fR>" 4
.IX Item "jeprof [options] <profile>"
<\fIprofile\fR> is a remote form. Each name can be:
.RS 4
.IP "\fI/path/to/profile\fR" 4
.IX Item "/path/to/profile"
a path to a profile file
.IP "\fIhost:port[/<service\fR]>" 4
.IX Item "host:port[/<service]>"
a location of a service to get the profile from.
.RE
.RS 4
.Sp
/<service> can be /pprof/heap, /pprof/profile, /pprof/pmuprofile, /pprof/growth,
/pprof/contention, /pprof/wall, /pprof/censusprofile, or /pprof/filteredprofile.
.Sp
For instance:
.Sp
.RS 4
jeprof http://myserver.example.com:80/pprof/heap
.RE
.RE
.RS 4
.Sp
If /<service> is omitted, the service defaults to /pprof/profile (\s-1CPU\s0
profiling).
.RE
.IP "\fBjeprof\fR \-\-symbols \fIprogram\fR" 4
.IX Item "jeprof --symbols program"
Maps addresses to symbol names. In this mode, stdin should be a list of library
mappings, in the same format as is found in the heap\- and CPU-profile files
(this loosely matches that of /proc/self/maps on Linux), followed by a list of
hex addresses to map, one per line.
.SH "OPTIONS AND ARGUMENTS"
.IX Header "OPTIONS AND ARGUMENTS"
.SS "Options"
.IX Subsection "Options"
.IP "\fB\-\-cum\fR" 4
.IX Item "--cum"
Sort by cumulative data.
.IP "\fB\-\-base=\fR\fIbase\fR" 4
.IX Item "--base=base"
Subtract <base> from <profile> before display.
.IP "\fB\-\-interactive\fR" 4
.IX Item "--interactive"
Run in interactive mode. (interactive \*(L"help\*(R" gives help) [default]
.IP "\fB\-\-seconds=\fR\fIn\fR" 4
.IX Item "--seconds=n"
Length of time for dynamic profiles. [default=30 secs]
.IP "\fB\-\-add_lib=\fR\fIfile\fR" 4
.IX Item "--add_lib=file"
Read additional symbols and line info from the given library.
.IP "\fB\-\-lib_prefix=\fR\fIdir\fR" 4
.IX Item "--lib_prefix=dir"
Comma separated list of library path prefixes.
.SS "Reporting granularity"
.IX Subsection "Reporting granularity"
.IP "\fB\-\-addresses\fR" 4
.IX Item "--addresses"
Report at address level.
.IP "\fB\-\-lines\fR" 4
.IX Item "--lines"
Report at source line level.
.IP "\fB\-\-functions\fR" 4
.IX Item "--functions"
Report at function level. [default]
.IP "\fB\-\-files\fR" 4
.IX Item "--files"
Report at source file level.
.SS "Output type"
.IX Subsection "Output type"
.IP "\fB\-\-text\fR" 4
.IX Item "--text"
Generate text report.
.IP "\fB\-\-callgrind\fR" 4
.IX Item "--callgrind"
Generate callgrind format to stdout.
.IP "\fB\-\-gv\fR" 4
.IX Item "--gv"
Generate Postscript and display.
.IP "\fB\-\-evince\fR" 4
.IX Item "--evince"
Generate \s-1PDF\s0 and display.
.IP "\fB\-\-web\fR" 4
.IX Item "--web"
Generate \s-1SVG\s0 and display.
.IP "\fB\-\-list=\fR\fIregexp\fR" 4
.IX Item "--list=regexp"
Generate source listing of matching routines.
.IP "\fB\-\-disasm=\fR\fIregexp\fR" 4
.IX Item "--disasm=regexp"
Generate disassembly of matching routines.
.IP "\fB\-\-symbols\fR" 4
.IX Item "--symbols"
Print demangled symbol names found at given addresses.
.IP "\fB\-\-dot\fR" 4
.IX Item "--dot"
Generate \s-1DOT\s0 file to stdout.
.IP "\fB\-\-ps\fR" 4
.IX Item "--ps"
Generate PostScript to stdout.
.IP "\fB\-\-pdf\fR" 4
.IX Item "--pdf"
Generate \s-1PDF\s0 to stdout.
.IP "\fB\-\-svg\fR" 4
.IX Item "--svg"
Generate \s-1SVG\s0 to stdout.
.IP "\fB\-\-gif\fR" 4
.IX Item "--gif"
Generate \s-1GIF\s0 to stdout.
.IP "\fB\-\-raw\fR" 4
.IX Item "--raw"
Generate symbolized jeprof data (useful with remote fetch).
.SS "Heap-profile options"
.IX Subsection "Heap-profile options"
.IP "\fB\-\-inuse_space\fR" 4
.IX Item "--inuse_space"
Display in-use (mega)bytes. [default]
.IP "\fB\-\-inuse_objects\fR" 4
.IX Item "--inuse_objects"
Display in-use objects.
.IP "\fB\-\-alloc_space\fR" 4
.IX Item "--alloc_space"
Display allocated (mega)bytes.
.IP "\fB\-\-alloc_objects\fR" 4
.IX Item "--alloc_objects"
Display allocated objects.
.IP "\fB\-\-show_bytes\fR" 4
.IX Item "--show_bytes"
Display space in bytes.
.IP "\fB\-\-drop_negative\fR" 4
.IX Item "--drop_negative"
Ignore negative differences.
.SS "Contention-profile options"
.IX Subsection "Contention-profile options"
.IP "\fB\-\-total_delay\fR" 4
.IX Item "--total_delay"
Display total delay at each region. [default]
.IP "\fB\-\-contentions\fR" 4
.IX Item "--contentions"
Display number of delays at each region.
.IP "\fB\-\-mean_delay\fR" 4
.IX Item "--mean_delay"
Display mean delay at each region.
.SS "Call-graph options"
.IX Subsection "Call-graph options"
.IP "\fB\-\-nodecount=\fR\fIn\fR" 4
.IX Item "--nodecount=n"
Show at most so many nodes. [default=80]
.IP "\fB\-\-nodefraction=\fR\fIf\fR" 4
.IX Item "--nodefraction=f"
Hide nodes below \fIf\fR*total. [default=.005]
.IP "\fB\-\-edgefraction=\fR\fIf\fR" 4
.IX Item "--edgefraction=f"
Hide edges below \fIf\fR*total. [default=.001]
.IP "\fB\-\-maxdegree=\fR\fIn\fR" 4
.IX Item "--maxdegree=n"
Max incoming/outgoing edges per node. [default=8]
.IP "\fB\-\-focus=\fR\fIregexp\fR" 4
.IX Item "--focus=regexp"
Focus on backtraces with nodes matching \fIregexp\fR.
.IP "\fB\-\-thread=\fR\fIn\fR" 4
.IX Item "--thread=n"
Show profile for thread \fIn\fR.
.IP "\fB\-\-ignore=\fR\fIregexp\fR" 4
.IX Item "--ignore=regexp"
Ignore backtraces with nodes matching \fIregexp\fR.
.IP "\fB\-\-scale=\fR\fIn\fR" 4
.IX Item "--scale=n"
Set \s-1GV\s0 scaling. [default=0]
.IP "\fB\-\-heapcheck\fR" 4
.IX Item "--heapcheck"
Make nodes with non\-0 object counts (i.e. direct leak generators) more visible.
.IP "\fB\-\-retain=\fR\fIregexp\fR" 4
.IX Item "--retain=regexp"
Retain only nodes that match \fIregexp\fR.
.IP "\fB\-\-exclude=\fR\fIregexp\fR" 4
.IX Item "--exclude=regexp"
Exclude all nodes that match \fIregexp\fR.
.SS "Miscellaneous"
.IX Subsection "Miscellaneous"
.IP "\fB\-\-tools=\fR\fIprefix\fR or \fB\-\-tools=\fR\fIbinary:fullpath[,...]\fR" 4
.IX Item "--tools=prefix or --tools=binary:fullpath[,...]"
Path for object tool pathnames.
.IP "\fB\-\-test\fR" 4
.IX Item "--test"
Run unit tests.
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
This message.
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
Version information.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
The following environment variables affect the execution of jeprof:
.IP "\fB\s-1JEPROF_TMPDIR\s0\fR" 4
.IX Item "JEPROF_TMPDIR"
Profiles directory. Defaults to \f(CW$HOME\fR/jeprof.
.IP "\fB\s-1JEPROF_TOOLS\s0\fR" 4
.IX Item "JEPROF_TOOLS"
Prefix for object tools pathnames.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.IP "jeprof /bin/ls ls.prof" 4
.IX Item "jeprof /bin/ls ls.prof"
Enters interactive mode.
.IP "jeprof \-\-text /bin/ls ls.prof" 4
.IX Item "jeprof --text /bin/ls ls.prof"
Generates one line per procedure.
.IP "jeprof \-\-web /bin/ls ls.prof" 4
.IX Item "jeprof --web /bin/ls ls.prof"
Displays annotated call-graph in web browser.
.IP "jeprof \-\-gv /bin/ls ls.prof" 4
.IX Item "jeprof --gv /bin/ls ls.prof"
Generates annotated call-graph and displays via \fBgv\fR.
.IP "jeprof \-\-gv \-\-focus=Mutex /bin/ls ls.prof" 4
.IX Item "jeprof --gv --focus=Mutex /bin/ls ls.prof"
Restrict to code paths that involve an entry that matches \fIMutex\fR.
.IP "jeprof \-\-gv \-\-focus=Mutex \-\-ignore=string /bin/ls ls.prof" 4
.IX Item "jeprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof"
Restrict to code paths that involve an entry that matches \fIMutex\fR and does not
match \fIstring\fR.
.IP "jeprof \-\-list=getdir /bin/ls ls.prof" 4
.IX Item "jeprof --list=getdir /bin/ls ls.prof"
Generates disassembly listing of all routines with at least one sample that
match \fBgetdir()\fR. The listing is annotated with the flat and cumulative sample
counts at each line.
.IP "jeprof \-\-disasm=getdir /bin/ls ls.prof" 4
.IX Item "jeprof --disasm=getdir /bin/ls ls.prof"
Generates disassembly listing of all routines with at least one sample that
match \fBgetdir()\fR. The listing is annotated with the flat and cumulative sample
counts at each \s-1PC\s0 value.
.IP "jeprof http://localhost:1234/" 4
.IX Item "jeprof http://localhost:1234/"
Enters interactive mode.
.IP "jeprof \-\-text localhost:1234" 4
.IX Item "jeprof --text localhost:1234"
Outputs one line per procedure for localhost:1234.
.IP "jeprof \-\-raw localhost:1234 > ./local.raw; jeprof \-\-text ./local.raw" 4
.IX Item "jeprof --raw localhost:1234 > ./local.raw; jeprof --text ./local.raw"
Fetches a remote profile for later analysis and then analyzes it in text mode.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBjemalloc\fR\|(3)