The pprof format represents execution profiles for storage or exchange. Based on a Protocol Buffers schema defined in profile.proto, it is the closest available standard for profile data on the wire or at rest, although no industry-wide standard exists. section 9.1.2 section 9.4
A Profile message can organize:
- Sample types and samples, which represent measured profile data. section 9.1.2
- Mappings, locations, lines, functions, and a string table for describing profiled code. section 9.1.2
- Timing metadata such as collection time and duration. section 9.1.2
Inspecting a compressed profile
Copy and decompress a pprof profile, then use protoc to decode its Function messages and grep for a function such as main.slowTask. This is practical for debugging, but less convenient than filtering JSON with command-line tools. section 9.1.2
message Profile {
repeated ValueType sample_type = 1; #1
repeated Sample sample = 2; #2
repeated Mapping mapping = 3; #3
repeated Location location = 4; #4
repeated Function function = 5; #5
repeated string string_table = 6; #6
int64 time_nanos = 9; #7
int64 duration_nanos = 10; #8
repeated int64 comment = 13; #9
}
Inspect the main Profile fields and their relationships in the protobuf schema. section 9.1.2
