From e0e4e0b8b7fabd8c214b838b8cb9a14ac618f16f Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 28 Feb 2025 18:17:33 -0300 Subject: [PATCH] perf maps: Add missing map__set_kmap_maps() when replacing a kernel map 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. Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Reviewed-by: Ian Rogers Link: https://lore.kernel.org/lkml/Z7-May5w9VQd5QD0@x1 Link: https://lore.kernel.org/r/20250228211734.33781-6-acme@kernel.org Signed-off-by: Namhyung Kim --- 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 77df9701d5ad..0b40d901675e 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; }