How google/pprof works
pprof accepts local or HTTP profiling data, optionally combines profiles and symbolizes addresses, then analyzes samples into text or graphical reports. The main command also offers interactive terminal and HTTP interfaces for refining and viewing results. The graph preserves documented capabilities whose implementations were not sampled; links for those are limited to relationships established by the README or sampled code.
Main entry points: driver.go Command driver · report.go Report analysis · fetch.go Profile fetch · webui.go HTTP web interface
Components 22
Profile ingestion
- Profile fetch
internal/driver/fetch.go - Profile decoding
profile/proto.go - Profile model
profile/profile.go - Profile merge
profile/merge.go
Profile analysis
- Unit scaling
internal/measurement/measurement.go - Profile refinement
profile/filter.go - Profile pruning
profile/prune.go - Report analysis
internal/report/report.go - Call graph
internal/graph/graph.go
Symbolization
- Symbolization
internal/symbolizer/symbolizer.go - Native binary tools
internal/binutils/binutils.go
User interfaces
- pprof command
pprof.go - Command driver
internal/driver/driver.go - Text reports
internal/report/report.go - Graph rendering
internal/driver/svg.go - Graphviz output
internal/graph/dotgraph.go - Terminal interface
internal/driver/interactive.go - HTTP web interface
internal/driver/webui.go - Web reports
internal/driver/webhtml.go
Other components
- Engineer
- Profile server
- Program binary
Connections 26
- Engineer → pprof command: invokes
- pprof command → Command driver: starts
- Command driver → Profile fetch: fetches profiles
- Profile server → Profile fetch: serves profile
- Profile fetch → Profile decoding: decodes data
- Profile decoding → Profile model: creates profile
- Profile fetch → Profile merge: combines profiles
- Profile merge → Profile model: merges data
- Command driver → Symbolization: symbolizes profile
- Program binary → Native binary tools: provides symbols
- Symbolization → Native binary tools: inspects binaries
- Command driver → Unit scaling: scales samples
- Command driver → Profile refinement: refines profile
- Command driver → Profile pruning: prunes profile
- Command driver → Report analysis: builds reports
- Report analysis → Call graph: summarizes samples
- Report analysis → Text reports: formats text
- Command driver → Graph rendering: renders graph
- Graph rendering → Graphviz output: generates visualization
- Command driver → Terminal interface: starts terminal mode
- Command driver → HTTP web interface: starts HTTP mode
- HTTP web interface → Web reports: serves report views
- Terminal interface → Report analysis: requests reports
- HTTP web interface → Report analysis: requests reports
- Engineer → Terminal interface: enters commands
- Engineer → HTTP web interface: uses browser