From 7fe8d496534b2a07f7173dd145a671f00ca65d32 Mon Sep 17 00:00:00 2001 From: Mahe Tardy Date: Wed, 19 Jun 2024 12:14:28 +0200 Subject: [PATCH] pkg/sensors: fix for ratelimit_map wrong path pinning [ upstream commit a1a24993b71df6e7065aa3772f4b53eb7b6e3d14 ] Commit 38ab0122a8d69368833457aad6d3d68858c0b561 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 --- pkg/sensors/tracing/generickprobe.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sensors/tracing/generickprobe.go b/pkg/sensors/tracing/generickprobe.go index ce90c45e6c8..e58cdf62b41 100644 --- a/pkg/sensors/tracing/generickprobe.go +++ b/pkg/sensors/tracing/generickprobe.go @@ -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) } @@ -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