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
[ upstream commit a1a2499 ]

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 Jul 16, 2024
1 parent 0120ac3 commit ca3509c
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 @@ -319,7 +319,7 @@ func createMultiKprobeSensor(sensorPath string, multiIDs, multiRetIDs []idtable.
}

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 @@ -968,7 +968,7 @@ func addKprobe(funcName string, f *v1alpha1.KProbeSpec, in *addKprobeIn, selMaps
}

if kernels.EnableLargeProgs() {
ratelimitMap := program.MapBuilderPin("ratelimit_map", sensors.PathJoin(in.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 ca3509c

Please sign in to comment.