Repolode
google

google/pprof

A command-line and web tool for visualizing and analyzing profiling data in the profile.proto format.

Stars
9,323
Forks
686
Open issues
64
Last commit
2 days ago

What is it?

pprof reads collections of profiling samples in the profile.proto format and generates reports that help developers understand where time or memory is spent. It produces text reports sorted by hotness, graphical call graphs rendered through Graphviz, and an interactive shell or web interface for exploring a profile.

Profiles can be loaded from a local file or fetched over HTTP, and multiple profiles of the same type can be aggregated or compared. If a profile contains raw machine addresses, pprof can symbolize them using the native binutils tools addr2line and nm, given the program binary. It can also read perf.data files from Linux perf through a companion converter.

Install it with go install github.com/google/pprof@latest. Graphviz is optional and only needed for graphic output. The project is not an official Google product.

Key features

  • 01Generates text reports sorted by hotness from profile data.
  • 02Produces SVG call graphs rendered via Graphviz.
  • 03Offers an interactive command shell and a browser-based web interface.
  • 04Reads profiles from local files or over HTTP.
  • 05Aggregates or compares multiple profiles of the same type.
  • 06Symbolizes addresses using addr2line and nm.

Use cases

  • Finding CPU or memory hotspots in a Go service from a collected profile.
  • Visualizing call graphs of a slow program to see which paths consume the most time.
  • Comparing profiles before and after a code change to measure its impact.
  • Analyzing Linux perf recordings by converting them to profile.proto format.

Quick start

  1. 1

    Install the Go development kit and Graphviz (optional, for graphical output)

  2. 2

    Build and install pprof with Go

    go install github.com/google/pprof@latest
  3. 3

    Generate a text report of a profile sorted by hotness

    pprof -top [main_binary] profile.pb.gz

Things to know

  • Graphical output requires a separate Graphviz installation.

In collections

Topics

FAQ

What is pprof?
A command-line and web tool for visualizing and analyzing profiling data in the profile.proto format. pprof reads collections of profiling samples in the profile.proto format and generates reports that help developers understand where time or memory is spent. It produces text reports sorted by hotness, graphical call graphs rendered through Graphviz, and an interactive shell or web interface for exploring a profile.
Is pprof free to use? What license does it have?
pprof is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is pprof still maintained?
Actively maintained. The last commit to pprof was on Nov 5, 2026.
What can I use pprof for?
Finding CPU or memory hotspots in a Go service from a collected profile. Visualizing call graphs of a slow program to see which paths consume the most time. Comparing profiles before and after a code change to measure its impact. Analyzing Linux perf recordings by converting them to profile.proto format.
How do I install pprof?
Install the Go development kit and Graphviz (optional, for graphical output) Build and install pprof with Go: go install github.com/google/pprof@latest Generate a text report of a profile sorted by hotness: pprof -top [main_binary] profile.pb.gz
Where can I get pprof?
The source code and installation instructions are on GitHub: https://github.com/google/pprof

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects