Skip to content

Commit

Permalink
Revert "fix: print_mem_dump fails on missing symbol (aquasecurity#3384)"
Browse files Browse the repository at this point in the history
This reverts commit 1a47a4e.
This is done because the commit cause the "symbols_loaded" event to
file and also cause many error messages that weren't seen before.
  • Loading branch information
AlonZivony committed Sep 5, 2023
1 parent 1a47a4e commit f5d7b28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions pkg/ebpf/tracee.go
Expand Up @@ -497,8 +497,8 @@ func (t *Tracee) generateInitValues() (InitValues, error) {
if !events.Core.IsDefined(evt) {
return initVals, errfmt.Errorf("event %d is undefined", evt)
}
if events.Core.GetDefinitionByID(evt).GetDependencies().GetKSymbols() != nil {
initVals.Kallsyms = true
for range events.Core.GetDefinitionByID(evt).GetDependencies().GetKSymbols() {
initVals.Kallsyms = true // only if length > 0
}
}

Expand Down Expand Up @@ -1700,8 +1700,7 @@ func (t *Tracee) triggerMemDump(event trace.Event) error {
}
}
if err != nil {
logger.Warnw("print_mem_dump: failed to get symbol info", "symbol", name)
continue
return errfmt.WrapError(err)
}
}
eventHandle := t.triggerContexts.Store(event)
Expand Down
8 changes: 3 additions & 5 deletions pkg/events/definition_dependencies.go
Expand Up @@ -38,12 +38,10 @@ func (d Dependencies) GetIDs() []ID {
return d.ids
}

// GetKSymbols returns the KSymbols dependencies of an event.
// If nil is returned no ksymbols are needed.
// If an empty array is returned - symbols are needed, but none should specifically
// be loaded ahead of time.
// A non-empty array indicates that some symbols should be queried and loaded ahead of time.
func (d Dependencies) GetKSymbols() []KSymbol {
if d.kSymbols == nil {
return []KSymbol{}
}
return d.kSymbols
}

Expand Down

0 comments on commit f5d7b28

Please sign in to comment.