Skip to content

Commit

Permalink
Avoid incrementing stats for invoked events
Browse files Browse the repository at this point in the history
  • Loading branch information
AlonZivony committed Apr 1, 2024
1 parent 4594c01 commit f49ce2d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions pkg/ebpf/tracee.go
Original file line number Diff line number Diff line change
Expand Up @@ -1630,23 +1630,20 @@ func (t *Tracee) invokeInitEvents(out chan *trace.Event) {
traceeDataEvent := events.InitTraceeDataEvent(t.bootTime, t.startTime)
setMatchedPolicies(&traceeDataEvent, emit)
out <- &traceeDataEvent
_ = t.stats.EventCount.Increment()
}

emit = t.eventsState[events.InitNamespaces].Emit
if emit > 0 {
systemInfoEvent := events.InitNamespacesEvent()
setMatchedPolicies(&systemInfoEvent, emit)
out <- &systemInfoEvent
_ = t.stats.EventCount.Increment()
}

emit = t.eventsState[events.ExistingContainer].Emit
if emit > 0 {
for _, e := range events.ExistingContainersEvents(t.containers, t.config.NoContainersEnrich) {
setMatchedPolicies(&e, emit)
out <- &e
_ = t.stats.EventCount.Increment()
}
}

Expand Down
1 change: 0 additions & 1 deletion pkg/events/ftrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func checkFtraceHooks(eventsCounter counter.Counter, out chan *trace.Event, base
event.ArgsNum = len(args)

out <- &event
_ = eventsCounter.Increment()
}

return nil
Expand Down

0 comments on commit f49ce2d

Please sign in to comment.