PPROF(1)
๐ PPROF โ the manual page, but make it make sense
okay so bestie, quick context before we dive in: pprof is part of gperftools, and it's basically the tool that reads your profiling data and tells you what your program is actually doing with its life. it's giving detective energy. let's go ๐ต๏ธโโ๏ธ
โจ SYNOPSIS โจ
pprof [options] <program> <profile>
๐ธ DESCRIPTION ๐ธ
pprof prints the specified cpu- or heap-profile. that's it, that's the whole pitch. you feed it a <program> and a <profile>, and it spills the tea about where your cycles (or your memory) went. lowkey iconic. ๐
๐ OPTIONS ๐
--cumโ sort by cumulative data. sort of a "give me the big picture" vibe.--base=<base>โ subtract <base> from <profile> before display. yes, literally math-ing one profile against another. ๐งฎ
๐ Reporting Granularity ๐
how zoomed-in do you wanna be, bestie? pick your level of detail:
--addressesโ report at address level (maximum zoom, no cap ๐)--linesโ report at source line level--functionsโ report at function level [default] โญ--filesโ report at source file level
๐จ๏ธ Output type ๐จ๏ธ
what format is your little report gonna come out in? choose your fighter:
--textโ generate text report [default] โจ--gvโ generate Postscript and display. it'll pop it open for you, so polite ๐--list=<regexp>โ generate source listing of matching routines--disasm=<regexp>โ generate disassembly of matching routines--dotโ generate DOT file to stdout--psโ generate Postscript to stdout--pdfโ generate PDF to stdout--gifโ generate GIF to stdout
๐ Heap-Profile Options ๐
these only matter when you're dealing with a heap profile, so like, vibe check the situation first:
--inuse_spaceโ display in-use (mega)bytes [default] ๐ธ--inuse_objectsโ display in-use objects--alloc_spaceโ display allocated (mega)bytes--alloc_objectsโ display allocated objects--show_bytesโ display space in bytes (for the people who want the raw numbers, respect ๐ซถ)--drop_negativeโ ignore negaive differences
ok so real talk, that's literally how it's spelled in the original โ negaive. not me fixing it. i would never. ๐
๐ฆ Call-graph Options ๐ฆ
the fine-tuning section. this is where you get to be picky:
--nodecount=<n>โ show at most so many nodes [default=80]--nodefraction=<f>โ hide nodes below<f>*total [default=.005]--edgefraction=<f>โ hide edges below<f>*total [default=.001]--focus=<regexp>โ focus on nodes matching <regexp>--ignore=<regexp>โ ignore nodes matching <regexp>--scale=<n>โ set GV scaling [default=0]
๐ฅ EXAMPLES ๐ฅ
here's where it clicks, fr fr:
pprof /bin/ls ls.prof
outputs one line per procedure. simple, clean, slay.
pprof --gv /bin/ls ls.prof
displays annotated call-graph via 'gv'. pretty pictures โจ
pprof --gv --focus=Mutex /bin/ls ls.prof
restricts to code paths including a .*Mutex.* entry.
pprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof
code paths including Mutex but not string. very "i want this but absolutely NOT that" of it ๐
pprof --list=getdir /bin/ls ls.prof
Dissassembly (with per-line annotations) for getdir()
pprof --disasm=getdir /bin/ls ls.prof
Dissassembly (with per-PC annotations) for getdir()
๐ COPYRIGHT ๐
Copyright ยฉ 2005 Google Inc.
๐ SEE ALSO ๐
further documentation for pprof is maintained as a web page called cpu_profiler.html and is likely installed at one of the following locations:
/usr/share/gperftools/cpu_profiler.html
/usr/local/share/gperftools/cpu_profiler.html
go read those, they're the main character energy of extra docs ๐ง
okay that's the whole page bestie, you're officially pprof-pilled ๐ this was pprof (part of gperftools), dated February 2005 โ vintage but still eating, ngl. mwah ๐๐ฆ
๐ฆ where this page comes from
- epel 10: pprof 2.15-4.el10_0 ยท BSD-3-Clause
- epel 9: pprof 2.9.1-3.el9 ยท BSD
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms