(data []byte)
| 211 | var errConcatProfile = fmt.Errorf("concatenated profiles detected") |
| 212 | |
| 213 | func parseLegacy(data []byte) (*Profile, error) { |
| 214 | parsers := []func([]byte) (*Profile, error){ |
| 215 | parseCPU, |
| 216 | parseHeap, |
| 217 | parseGoCount, // goroutine, threadcreate |
| 218 | parseThread, |
| 219 | parseContention, |
| 220 | parseJavaProfile, |
| 221 | } |
| 222 | |
| 223 | for _, parser := range parsers { |
| 224 | p, err := parser(data) |
| 225 | if err == nil { |
| 226 | p.addLegacyFrameInfo() |
| 227 | return p, nil |
| 228 | } |
| 229 | if err != errUnrecognized { |
| 230 | return nil, err |
| 231 | } |
| 232 | } |
| 233 | return nil, errUnrecognized |
| 234 | } |
| 235 | |
| 236 | // ParseUncompressed parses an uncompressed protobuf into a profile. |
| 237 | func ParseUncompressed(data []byte) (*Profile, error) { |
no test coverage detected
searching dependent graphs…