Skip to content

Commit

Permalink
pkg/sensors: fix for ratelimit_map wrong path pinning
Browse files Browse the repository at this point in the history
Commit 38ab012 pinned the ratelimit_map
to the fs but used sensorPath instead pinPath since this is a per kprobe
map and not a per sensor map.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Jun 19, 2024
1 parent 74826da commit a1a2499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sensors/tracing/generickprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func createMultiKprobeSensor(sensorPath, policyName string, multiIDs []idtable.E
}

if kernels.EnableLargeProgs() {
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load)
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(pinPath, "ratelimit_map"), load)
if oneKprobeHasRatelimit {
ratelimitMap.SetMaxEntries(ratelimitMapMaxEntries)
}
Expand Down Expand Up @@ -918,7 +918,7 @@ func createKprobeSensorFromEntry(kprobeEntry *genericKprobe, sensorPath string,
}

if kernels.EnableLargeProgs() {
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(sensorPath, "ratelimit_map"), load)
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(pinPath, "ratelimit_map"), load)
if kprobeEntry.hasRatelimit {
// similarly as for stacktrace, we expand the max size only if
// needed to reduce the memory footprint when unused
Expand Down

0 comments on commit a1a2499

Please sign in to comment.