MCPcopy Create free account
hub / github.com/google/pprof / encode

Method encode

profile/encode.go:133–161  ·  view source on GitHub ↗
(b *buffer)

Source from the content-addressed store, hash-verified

131}
132
133func (p *Profile) encode(b *buffer) {
134 for _, x := range p.SampleType {
135 encodeMessage(b, 1, x)
136 }
137 for _, x := range p.Sample {
138 encodeMessage(b, 2, x)
139 }
140 for _, x := range p.Mapping {
141 encodeMessage(b, 3, x)
142 }
143 for _, x := range p.Location {
144 encodeMessage(b, 4, x)
145 }
146 for _, x := range p.Function {
147 encodeMessage(b, 5, x)
148 }
149 encodeStrings(b, 6, p.stringTable)
150 encodeInt64Opt(b, 7, p.dropFramesX)
151 encodeInt64Opt(b, 8, p.keepFramesX)
152 encodeInt64Opt(b, 9, p.TimeNanos)
153 encodeInt64Opt(b, 10, p.DurationNanos)
154 if pt := p.PeriodType; pt != nil && (pt.typeX != 0 || pt.unitX != 0) {
155 encodeMessage(b, 11, p.PeriodType)
156 }
157 encodeInt64Opt(b, 12, p.Period)
158 encodeInt64s(b, 13, p.commentX)
159 encodeInt64(b, 14, p.defaultSampleTypeX)
160 encodeInt64Opt(b, 15, p.docURLX)
161}
162
163var profileDecoder = []decoder{
164 nil, // 0

Callers

nothing calls this directly

Calls 5

encodeMessageFunction · 0.85
encodeStringsFunction · 0.85
encodeInt64OptFunction · 0.85
encodeInt64sFunction · 0.85
encodeInt64Function · 0.85

Tested by

no test coverage detected