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

Function focusedAndNotIgnored

profile/filter.go:233–248  ·  view source on GitHub ↗

focusedAndNotIgnored looks up a slice of ids against a map of focused/ignored locations. The map only contains locations that are explicitly focused or ignored. Returns whether there is at least one focused location but no ignored locations.

(locs []*Location, m map[uint64]bool)

Source from the content-addressed store, hash-verified

231// explicitly focused or ignored. Returns whether there is at least
232// one focused location but no ignored locations.
233func focusedAndNotIgnored(locs []*Location, m map[uint64]bool) bool {
234 var f bool
235 for _, loc := range locs {
236 if focus, focusOrIgnore := m[loc.ID]; focusOrIgnore {
237 if focus {
238 // Found focused location. Must keep searching in case there
239 // is an ignored one as well.
240 f = true
241 } else {
242 // Found ignored location. Can return false right away.
243 return false
244 }
245 }
246 }
247 return f
248}
249
250// TagMatch selects tags for filtering
251type TagMatch func(s *Sample) bool

Callers 1

FilterSamplesByNameMethod · 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…