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

Method lastMatchedLineIndex

profile/filter.go:135–144  ·  view source on GitHub ↗

lastMatchedLineIndex returns the index of the last line that matches a regex, or -1 if no match is found.

(re *regexp.Regexp)

Source from the content-addressed store, hash-verified

133// lastMatchedLineIndex returns the index of the last line that matches a regex,
134// or -1 if no match is found.
135func (loc *Location) lastMatchedLineIndex(re *regexp.Regexp) int {
136 for i := len(loc.Line) - 1; i >= 0; i-- {
137 if fn := loc.Line[i].Function; fn != nil {
138 if re.MatchString(fn.Name) || re.MatchString(fn.Filename) {
139 return i
140 }
141 }
142 }
143 return -1
144}
145
146// FilterTagsByName filters the tags in a profile and only keeps
147// tags that match show and not hide.

Callers 1

filterShowFromLocationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected