pprof Profile Analyzer
Drop a pprof file and read sample types, duration and the top functions by flat and cumulative value, the go tool pprof top view, with gzip handled locally.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the pprof Profile Analyzer?
Drop a pprof file, the profile.pb.gz a Go service writes, and read the top of it: the sample types it carries, when and for how long it was collected, and the functions ranked by flat and cumulative value, the same table go tool pprof top prints. The gzip wrapper is decompressed by this page's own RFC 1951 inflate and the protobuf is decoded field by field, all in your tab.
pprof's native format is a gzip-compressed profile.proto message; the proto file itself says the serialized proto must be gzip-compressed on disk. Go's runtime/pprof writes it ("the gzip-compressed protocol buffer", per the package docs), net/http/pprof serves it at /debug/pprof/, and the same format carries heap, mutex and goroutine profiles, not just CPU. This page reads whichever sample types the file declares and totals them.
The honest boundary: this is the top view, not the whole tool. Flame graphs, call graphs, source and peek views need the full symbol graph and a renderer, and go tool pprof -http=:8080 profile.pb.gz already does them well. What a browser page adds is the fast first look on a machine without a Go toolchain, and a decode that works when all you have is the file.
- Reads gzipped or raw profile.proto files; the RFC 1952 wrapper is inflated in the browser
- Sample types with units, sample count, duration, capture time and per-type totals
- Top functions by flat and by cumulative value, the go tool pprof top table
- Ranking by the last sample type, the default the proto itself tells clients to use
- Mapping names listed, so you can see which binary the profile came from
- Refusals that name the check: wrong magic, truncated varints, a string table that does not start empty
- Copyable text summary; the file never leaves your browser
Updated
How to use the pprof Profile Analyzer
- Get the file: curl the /debug/pprof/profile endpoint of a Go service, call pprof.WriteHeapProfile in code, or take the profile.pb.gz an incident channel attached.
- Drop it here, gzipped or raw; the 1F 8B magic is detected and inflated locally.
- Or press Load a sample to see a tiny two-function CPU profile whose numbers are pinned in this site's tests.
- Read the header row: sample count, sample types with units, duration and capture time. A 30-second CPU profile with 0.2 seconds of total cpu means a mostly idle service, which is an answer by itself.
- Scan top by flat for the functions burning the value directly, then top by cumulative for the callers that own them. The flat column of a parent and the cum column of its children usually tell the story together.
- For flame graphs, source listings or comparing two profiles, run go tool pprof -http=:8080 <file>; this page is the triage step, not the replacement.
Worked examples
The sample profile, read like go tool pprof top
Input
The built-in sample: 2 samples, cpu/nanoseconds, 10s duration
Output
main.hot: 10.0ms flat, 10.0ms cum · main.caller: 0 flat, 3.0ms cum
main.hot is the leaf of both samples (7 ms and 3 ms), so all 10 ms is flat. main.caller appears only above main.hot in the second sample, so it gets 3 ms of cum and no flat: the classic dispatcher signature, scaled down to two stacks.
A CPU profile from a live Go service
Input
curl -o cpu.pb.gz "http://localhost:6060/debug/pprof/profile?seconds=30"
Output
Sample types samples/count and cpu/nanoseconds; the table ranks by cpu time
net/http/pprof serves the profile in the format the pprof tool expects. The last sample type is the ranking value per the proto's own client guidance, so the table orders by nanoseconds of CPU, and the totals row shows the raw sample count beside it.
A heap profile answers a different question
Input
A pprof heap profile (alloc_objects, alloc_space, inuse_objects, inuse_space)
Output
Four sample types listed; the table ranks by the last, inuse_space in bytes
Same container, different physics: values are bytes and object counts, not time, and flat means memory attributed to allocations in that function. The header row naming all four types is the reminder that the table is one view of four.
Not a pprof file, said plainly
Input
A py-spy or async-profiler output renamed to .pb.gz
Output
Not a pprof profile: the string table must start with the empty string (profile.proto).
py-spy writes flamegraph, speedscope, raw and chrometrace formats; async-profiler writes collapsed, flame graph, tree, text, JFR and OTLP. Neither emits pprof, so the refusal names the actual check that failed instead of pretending to read them.
Background and insight
A profile is one protobuf message. Field 1 lists the sample types as pairs of string-table indices (cpu/nanoseconds, alloc_space/bytes); field 2 holds the samples, each a stack of location ids, leaf first per the proto comment, with one value per sample type; fields 4 and 5 map locations to functions and functions to names; field 6 is the string table, whose first entry must be the empty string, which is also how this parser tells pprof from other varint soup. Duration and collection time are fields 10 and 9, in nanoseconds.
Flat and cumulative are stack arithmetic. The pprof docs define flat as the samples in the function itself and cum as the samples in the function and its callees. In practice: a value attributed to the leaf location counts as flat for that function; every function anywhere on the sample's stack collects the value into its cum, once. A function with high cum and near-zero flat is a dispatcher, and the fix lives below it; high flat is the function itself burning the budget.
When a profile carries several sample types, one must be chosen for the table. The proto's own guidance for the default_sample_type field is that clients should default to the last sample value when it is unset, and that is what this page does: a Go CPU profile's table therefore ranks by cpu nanoseconds, a heap profile's by its final space type. The totals row still shows every type, so the other readings are not hidden.
Common use cases
Triaging a profile from an incident ticket
The attachment opens in seconds without a Go toolchain: duration, sample types and the top ten by flat are usually enough to say "regression in X" or "nothing burning here".
Checking a profile before sharing it
Function names and file paths from the string table are visible here, so you see exactly what internal naming a profile would leak before it leaves the company.
Reading profiles on a locked-down machine
No go install, no network: the gunzip and the proto decode are local JavaScript, which is the point when the profile comes from production.
Sanity-checking a collection pipeline
If your continuous profiler claims 30-second windows and the duration field says 5, the pipeline is lying somewhere; the header row reads the file's own claim.
Learning what flat and cum mean
The two-function sample makes the definitions concrete: the same 3 ms appearing as a child's flat and a parent's cum is the whole concept in one row each.
Tips and limitations
- Flat sums to the profile total across all functions; cum does not, because every frame on a stack collects the same value. A cum column that dwarfs the total is normal, not double counting.
- A CPU profile's duration field and its total cpu are different things: 10 s of wall clock with 2 s of cpu means either an idle service or blocked time, which CPU sampling cannot see. Block and mutex profiles exist for that.
- Names come from the profile's own string table. A table full of raw addresses means the binary was stripped before symbolization; re-run collection where symbols exist, since no viewer can invent names.
- The count next to a type matters: 2 samples prove nothing. At Go's default 100 Hz CPU sampling, a function needs to burn roughly 10 ms before it is likely to appear at all, so thin profiles under-report rare costs.
- Totals are per sample type, and the table ranks by the last one. When the type you care about is not last (alloc_space in a heap profile, say), read the totals row here and switch to go tool pprof -sample_index for the full re-ranking.
- The decode tops out at the top 15 functions by design. If your question is "who calls whom", that is the call graph, and go tool pprof -http draws it better than any table.
Sources and further reading
- profile.proto, google/pprof on GitHub. The message this decoder reads: field numbers, leaf-first stacks, the gzip requirement, the empty first string
- pprof user documentation, google/pprof on GitHub. The flat and cum definitions, the top view, and the -http web interface with flame graphs
- Package runtime/pprof, Go package documentation. Go writes "the gzip-compressed protocol buffer" this page decodes
Frequently asked questions
How do I open a profile.pb.gz file without Go installed?
Drop it here: the gzip layer is inflated locally and the profile.proto inside is decoded to the header facts and the top table. That covers triage. For flame graphs, source views and diffs you still want go tool pprof -http, which is the full product this page deliberately does not reimplement.
What is the difference between flat and cum in pprof?
The pprof docs define flat as samples in the function itself and cum as samples in the function and its callees. A sort by flat finds the code burning cycles directly; a sort by cum finds the entry points that own the cost. High cum with near-zero flat marks a dispatcher whose children do the work.
What format is a pprof file, exactly?
A gzip-compressed protobuf message defined by profile.proto in the google/pprof repository; the proto states the on-disk serialization must be gzip-compressed. Strings live in one deduplicated table whose first entry must be empty, samples reference locations leaf first, and values are int64 per declared sample type.
Does py-spy or async-profiler produce pprof files?
No. py-spy records flamegraph SVG, speedscope, raw and chrometrace outputs; async-profiler documents collapsed, flame graph, tree, text, JFR and OTLP. The pprof format is native to Go tooling and the profilers that adopted it; files from those two need their own viewers or a converter.
Which sample type does the top table use when a profile has several?
The last one, which is what profile.proto tells clients to default to when default_sample_type is unset. For a Go CPU profile that is cpu/nanoseconds; for a heap profile, the final space type. The totals for every other type are shown above the table so nothing is hidden by the choice.
Why does my profile show addresses instead of function names?
The names were never in the file: symbolization happens at collection, and a stripped binary leaves the string table empty of useful names. Collect again from a build with symbols, or symbolize server-side; a viewer can only print the strings the profile carries.
Can this show a flame graph of my profile?
No, and that is deliberate: a faithful flame graph needs the full call-tree merge that go tool pprof -http=:8080 renders interactively, alongside graph, peek and source views. This page is the fast first read, the top table plus the header facts, for machines where installing the toolchain is not worth it.
Is there an in-depth guide to the pprof Profile Analyzer?
Yes. “How to Read Binary Files Without Running Them” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.