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

Method matchesName

profile/filter.go:179–191  ·  view source on GitHub ↗

matchesName returns whether the location matches the regular expression. It checks any available function names, file names, and mapping object filename.

(re *regexp.Regexp)

Source from the content-addressed store, hash-verified

177// expression. It checks any available function names, file names, and
178// mapping object filename.
179func (loc *Location) matchesName(re *regexp.Regexp) bool {
180 for _, ln := range loc.Line {
181 if fn := ln.Function; fn != nil {
182 if re.MatchString(fn.Name) || re.MatchString(fn.Filename) {
183 return true
184 }
185 }
186 }
187 if m := loc.Mapping; m != nil && re.MatchString(m.File) {
188 return true
189 }
190 return false
191}
192
193// unmatchedLines returns the lines in the location that do not match
194// the regular expression.

Callers 1

FilterSamplesByNameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected