Skip to content

Commit

Permalink
fix(ebpf): use log debug level instead of error... (#3985)
Browse files Browse the repository at this point in the history
... for internal requirements.

Considering that if GetLast() failed t.config.Policies is nil, this also
removes the use of t.config.Policies. Furthermore, the goal is to
concetrate all Policies access in the PolicyManager.
  • Loading branch information
geyslan authored Apr 17, 2024
1 parent 82519a1 commit e8d7a35
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/ebpf/tracee.go
Original file line number Diff line number Diff line change
Expand Up @@ -1592,15 +1592,14 @@ func (t *Tracee) triggerMemDump(event trace.Event) []error {
// We want to use the policies of relevant to the triggering event
policies, err := policy.Snapshots().Get(event.PoliciesVersion)
if err != nil {
logger.Errorw("Error getting policies for print_mem_dump event", "error", err)
// For fallback, try to use latest polcies
logger.Debugw("Error getting policies for print_mem_dump event", "error", err)
// For fallback, try to use latest policies
policies, err = policy.Snapshots().GetLast()
if err != nil {
logger.Errorw("Error getting last snapshots policies for print_mem_dump event", "error", err)
// Last resort is to use the policies from the config
policies = t.config.Policies
return []error{err}
}
}

for it := policies.CreateAllIterator(); it.HasNext(); {
p := it.Next()
// This might break in the future if PrintMemDump will become a dependency of another event.
Expand Down

0 comments on commit e8d7a35

Please sign in to comment.