diff --git a/pkg/ebpf/tracee.go b/pkg/ebpf/tracee.go index 3f1c71228afe..6f3af7f1683d 100644 --- a/pkg/ebpf/tracee.go +++ b/pkg/ebpf/tracee.go @@ -949,7 +949,10 @@ func (t *Tracee) validateKallsymsDependencies() { for eventId := range t.eventsState { if !validateEvent(eventId) { // Cancel the event, it dependencies and its dependent events - t.eventsDependencies.RemoveEvent(eventId) + err := t.eventsDependencies.RemoveEvent(eventId) + if err != nil { + logger.Warnw("Failed to remove event from dependencies manager", "remove reason", "missing ksymbols", "error", err) + } } } } @@ -1181,7 +1184,10 @@ func (t *Tracee) attachProbes() error { for eventID := range t.eventsState { err := t.attachEvent(eventID) if err != nil { - t.eventsDependencies.RemoveEvent(eventID) + err := t.eventsDependencies.RemoveEvent(eventID) + if err != nil { + logger.Warnw("Failed to remove event from dependencies manager", "remove reason", "failed probes attachment", "error", err) + } } } // TODO: Update the eBPF maps according to events state after failure of attachments diff --git a/pkg/events/dependencies/manager.go b/pkg/events/dependencies/manager.go index 028b5fd79778..5499487fffa0 100644 --- a/pkg/events/dependencies/manager.go +++ b/pkg/events/dependencies/manager.go @@ -173,9 +173,10 @@ func (m *Manager) buildEventNode(eventNode *EventNode) (*EventNode, error) { if probe.IsRequired() { return nil, err } + eventName := events.Core.GetDefinitionByID(eventNode.GetID()).GetName() logger.Debugw( "Non-required probe dependency adding failed for event", - "event", eventNode.GetID(), + "event", eventName, "probe", probe.GetHandle(), "error", err, ) continue @@ -340,7 +341,11 @@ func (m *Manager) removeEventNodeFromDependencies(eventNode *EventNode) { // removeEventDependents removes all dependent events from the tree func (m *Manager) removeEventDependents(eventNode *EventNode) { for _, dependentEvent := range eventNode.GetDependents() { - m.RemoveEvent(dependentEvent) + err := m.RemoveEvent(dependentEvent) + if err != nil { + eventName := events.Core.GetDefinitionByID(dependentEvent).GetName() + logger.Debugw("failed to remove dependent event", "event", eventName, "error", err) + } } }