Skip to content

Commit

Permalink
pkg/sensors: pin the ratelimit_map to the fs
Browse files Browse the repository at this point in the history
Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Jun 14, 2024
1 parent ed824b3 commit 38ab012
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/sensors/tracing/generickprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ func createMultiKprobeSensor(sensorPath, policyName string, multiIDs []idtable.E
maps = append(maps, socktrack)
}

if kernels.EnableLargeProgs() {
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load)
maps = append(maps, ratelimitMap)
}

enforcerDataMap := enforcerMap(policyName, load)
maps = append(maps, enforcerDataMap)

Expand Down Expand Up @@ -900,6 +905,11 @@ func createKprobeSensorFromEntry(kprobeEntry *genericKprobe, sensorPath string,
maps = append(maps, socktrack)
}

if kernels.EnableLargeProgs() {
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load)
maps = append(maps, ratelimitMap)
}

enforcerDataMap := enforcerMap(kprobeEntry.policyName, load)
maps = append(maps, enforcerDataMap)

Expand Down

0 comments on commit 38ab012

Please sign in to comment.