PPROF(1)

πŸ’… PPROF(1) β€” aka google-pprof

okay bestie, sit down, hydrate, and let me tell you about google-pprof ✨ it's the manual page for google-pprof, which is part of gperftools (yes that gperftools, the iconic one). it's literally a profiler-reading bestie and it's here to tell you where your program is spending all its time. πŸŽ€


✨ SYNOPSIS ✨

google-pprof [options] <program> <profile>

🌸 DESCRIPTION 🌸

it prints the specified cpu- or heap-profile. that's the whole vibe. you give it a program and a profile, it gives you the tea. β˜•πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

  • --cum β€” sort by cumulative</> data. like, the totals, not just the individual moment.
  • --base=<base> β€” subtract <base> from <profile> before it gets displayed. math first, pretty later. ✨

πŸ“Š Reporting Granularity πŸ“Š

how zoomed-in do you want the receipts, bestie?

  • --addresses β€” report at the address level
  • --lines β€” report at the source line level
  • --functions β€” report at the function level [default]
  • --files β€” report at the source file level

🎨 Output type 🎨

pick your aesthetic. it's giving choices. πŸ’–

  • --text β€” generate a text report [default]
  • --gv β€” generate Postscript and display it
  • --list=<regexp> β€” generate a source listing of the matching routines
  • --disasm=<regexp> β€” generate disassembly of the matching routines
  • --dot β€” generate a DOT file to stdout
  • --ps β€” generate Postscript to stdout
  • --pdf β€” generate PDF to stdout
  • --gif β€” generate GIF to stdout

🫧 Heap-Profile Options 🫧

  • --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
  • --drop_negative β€” ignore negaive differences

πŸ¦‹ Call-graph Options πŸ¦‹

  • --nodecount=<n> β€” show at most this 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 🌈

watch and learn, this is the good part πŸ‘‘

google-pprof /bin/ls ls.prof

outputs one line per procedure

google-pprof --gv /bin/ls ls.prof

displays an annotated call-graph via 'gv'

google-pprof --gv --focus=Mutex /bin/ls ls.prof

restricts to code paths including a .*Mutex.* entry

google-pprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof

code paths including Mutex but not string

google-pprof --list=getdir /bin/ls ls.prof

dissassembly (with per-line annotations) for getdir()

google-pprof --disasm=getdir /bin/ls ls.prof

dissassembly (with per-PC annotations) for getdir()


Copyright Β© 2005 Google Inc.


πŸ”₯ SEE ALSO πŸ”₯

further documentation for google-pprof is maintained as a web page called cpu_profiler.html and is likely installed at one of the following locations:

/usr/share/doc/libgoogle-perftools-dev/cpuprofile.html
/usr/local/share/gperftools/cpu_profiler.html

and that's the whole page bestie 🫢 this lil icon came from google-pprof (part of gperfto... and it's dated February 2005. historic. legendary. slay. πŸ’…βœ¨