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

Function parseMappingEntry

profile/legacy_profile.go:1044–1075  ·  view source on GitHub ↗
(l string)

Source from the content-addressed store, hash-verified

1042}
1043
1044func parseMappingEntry(l string) (*Mapping, error) {
1045 var start, end, perm, file, offset, buildID string
1046 if me := procMapsRE.FindStringSubmatch(l); len(me) == 6 {
1047 start, end, perm, offset, file = me[1], me[2], me[3], me[4], me[5]
1048 } else if me := briefMapsRE.FindStringSubmatch(l); len(me) == 7 {
1049 start, end, perm, file, offset, buildID = me[1], me[2], me[3], me[4], me[5], me[6]
1050 } else {
1051 return nil, errUnrecognized
1052 }
1053
1054 var err error
1055 mapping := &Mapping{
1056 File: file,
1057 BuildID: buildID,
1058 }
1059 if perm != "" && !strings.Contains(perm, "x") {
1060 // Skip non-executable entries.
1061 return nil, nil
1062 }
1063 if mapping.Start, err = strconv.ParseUint(start, 16, 64); err != nil {
1064 return nil, errUnrecognized
1065 }
1066 if mapping.Limit, err = strconv.ParseUint(end, 16, 64); err != nil {
1067 return nil, errUnrecognized
1068 }
1069 if offset != "" {
1070 if mapping.Offset, err = strconv.ParseUint(offset, 16, 64); err != nil {
1071 return nil, errUnrecognized
1072 }
1073 }
1074 return mapping, nil
1075}
1076
1077var memoryMapSentinels = []string{
1078 "--- Memory map: ---",

Callers 1

parseProcMapsFromScannerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…