Understand the profile.proto data format
mainprofile.proto is a data representation for profiling data, independent of the collection method. On disk, it is stored as a gzip-compressed protocol buffer. A profile consists of a collection of samples, where each sample associates measurement values with a call stack (a list of location IDs).
Key components of a profile include:
- Samples: Measurements and associated call stacks. Identical call stacks can be merged by summing their values.
- Locations: Unique program locations (often instruction addresses) referenced by samples.
- Functions: Program functions containing human-readable (demangled) and system (mangled) names, and source file information.
- Mappings: Binary information (similar to Linux
/proc/self/maps) used to symbolize instruction addresses. - String Table: An index of all strings used in the profile to save space.
- Labels: Annotations (string or numeric) used to differentiate samples with identical locations (e.g., distinguishing between different allocation sizes).