diff options
author | Changbin Du <changbin.du@gmail.com> | 2019-03-16 11:05:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-20 10:16:54 +0300 |
commit | 60b7f41c4aea4d09bc36c957014e4bc7aa056597 (patch) | |
tree | ca8766ad7c87223b71c8d4ed6dd1e807d07795e0 /tools/perf/util | |
parent | d86bf97d119d9dfdb2c2ac9f3f5602c4107bdb57 (diff) | |
download | linux-60b7f41c4aea4d09bc36c957014e4bc7aa056597.tar.xz |
perf map: Remove map from 'names' tree in __maps__remove()
[ Upstream commit b49265e04410b97b31a5ee66ef6782c1b2d6cd2c ]
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 <changbin.du@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Saint-Etienne <eric.saint.etienne@oracle.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: 1e6285699b30 ("perf symbols: Fix slowness due to -ffunction-section")
Link: http://lkml.kernel.org/r/20190316080556.3075-11-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 6751301a755c..750ecc3dad50 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -911,6 +911,9 @@ static void __maps__remove(struct maps *maps, struct map *map) { rb_erase_init(&map->rb_node, &maps->entries); map__put(map); + + rb_erase_init(&map->rb_node_name, &maps->names); + map__put(map); } void maps__remove(struct maps *maps, struct map *map) |