MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / IsBitSet

Method IsBitSet

pkg/event/bitset.go:84–90  ·  view source on GitHub ↗

IsBitSet checks if any of the populated bitsets contain the type, event ID, or category bit. This method evaluates first the event type bitset. The event type bitset should only be initialized if all event types pertain to the same category. Otherwise, event id bitset and last category bitset are te

(evt *Event)

Source from the content-addressed store, hash-verified

82// Otherwise, event id bitset and last category bitset
83// are tested for respective bits.
84func (b *BitSets) IsBitSet(evt *Event) bool {
85 if b.types != nil && b.types.Test(uint(evt.Type.HookID())) {
86 return true
87 }
88 return (b.bitmask != nil && b.bitmask.IsSet(evt.Type.ID())) ||
89 (b.cats != nil && b.cats.Test(uint(evt.Category.Index())))
90}
91
92// IsInitialized checks if the given bitset type is initialized.
93func (b *BitSets) IsInitialized(bs BitSetType) bool {

Callers 2

TestBitSetsFunction · 0.95
IsEvaluableMethod · 0.80

Calls 4

IsSetMethod · 0.80
IndexMethod · 0.80
HookIDMethod · 0.45
IDMethod · 0.45

Tested by 1

TestBitSetsFunction · 0.76