-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
[edit (3 Oct 2016) we now propose to just return the profiles in the serialized proto format. The proposal previously also gzipped the proto]
I propose to add a function
func runtime/pprof.StartCPUProfileProto(w io.Writer) error
and support in the runtime, for generating profiles in serialized profile protocol buffers, rather than in the legacy pprof format.
The profile proto is more extensible than the legacy pprof format and is pprof's preferred profile format. The extensibility will be useful to support generating profiles with labels. pprof supports rendering labeled profiles, but labels can only appear in the proto profile, not in the legacy format.
The profile proto format is already understood by pprof itself and pprof already includes an encoder for producing serialized profile protos without requiring a dependency on the proto package or library.
Here's the pprof proto description: https://github.com/google/pprof/blob/master/proto/profile.proto
and here's the encoder: https://github.com/google/pprof/blob/master/profile/proto.go
For more about labels, take a look at the https://github.com/google/pprof/blob/master/doc/developer/profile.proto.md#labels