Skip to content

Commit

Permalink
bpf: use scoped logging in Map.DeleteAll()
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Beckers <[email protected]>
  • Loading branch information
ti-mo committed Jun 14, 2023
1 parent 0cbe507 commit f68f0d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/bpf/map_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ func (m *Map) DeleteAll() error {

err := i.Err()
if err != nil {
log.WithError(err).Warningf("Unable to correlate iteration key %v with cache entry. Inconsistent cache.", mk)
scopedLog.WithError(err).Warningf("Unable to correlate iteration key %v with cache entry. Inconsistent cache.", mk)
}

return err
Expand Down Expand Up @@ -1054,7 +1054,6 @@ func (m *Map) resolveErrors(ctx context.Context) error {
case OK:
case Insert:
// Call into ebpf-go's Map.Update() directly, don't go through the cache.

err := m.m.Update(e.Key, e.Value, ebpf.UpdateAny)
if metrics.BPFMapOps.IsEnabled() {
metrics.BPFMapOps.WithLabelValues(m.commonName(), metricOpUpdate, metrics.Error2Outcome(err)).Inc()
Expand All @@ -1072,7 +1071,6 @@ func (m *Map) resolveErrors(ctx context.Context) error {
m.addToEventsLocked(MapUpdate, *e)
case Delete:
// Holding lock, issue direct delete on map.

err := m.m.Delete(e.Key)
if metrics.BPFMapOps.IsEnabled() {
metrics.BPFMapOps.WithLabelValues(m.commonName(), metricOpDelete, metrics.Error2Outcome(err)).Inc()
Expand Down

0 comments on commit f68f0d4

Please sign in to comment.