[PATCH 5/6] perf maps: Add missing map__set_kmap_maps() when replacing a kernel map
From: Arnaldo Carvalho de Melo
Date: Fri Feb 28 2025 - 16:18:56 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Since in this case __maps__insert_sorted() is not called and thus
doesn't have the opportunity to do the needed map__set_kmap_maps() calls on
the new map.
Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: James Clark <james.clark@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: https://lore.kernel.org/lkml/Z7-May5w9VQd5QD0@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/maps.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/maps.c b/tools/perf/util/maps.c
index 77df9701d5ad7de3..0b40d901675ed57e 100644
--- a/tools/perf/util/maps.c
+++ b/tools/perf/util/maps.c
@@ -948,6 +948,8 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)
maps_by_name[ni] = map__get(new);
}
+ map__set_kmap_maps(new, maps);
+
check_invariants(maps);
return err;
}
--
2.48.1