Skip to content

Commit b49265e

Browse files
changbinduacmel
authored andcommitted
perf map: Remove map from 'names' tree in __maps__remove()
There are two trees for each map inserted by maps__insert(), so remove it from the 'names' tree in __maps__remove(). Detected with gcc's ASan. Signed-off-by: Changbin Du <[email protected]> Reviewed-by: Jiri Olsa <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Eric Saint-Etienne <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Fixes: 1e62856 ("perf symbols: Fix slowness due to -ffunction-section") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent cb6186a commit b49265e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/perf/util/map.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,9 @@ static void __maps__remove(struct maps *maps, struct map *map)
917917
{
918918
rb_erase_init(&map->rb_node, &maps->entries);
919919
map__put(map);
920+
921+
rb_erase_init(&map->rb_node_name, &maps->names);
922+
map__put(map);
920923
}
921924

922925
void maps__remove(struct maps *maps, struct map *map)

0 commit comments

Comments
 (0)