lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:perf/urgent] perf map: Remove map from 'names' tree in __maps__remove()
    Commit-ID:  b49265e04410b97b31a5ee66ef6782c1b2d6cd2c
    Gitweb: https://git.kernel.org/tip/b49265e04410b97b31a5ee66ef6782c1b2d6cd2c
    Author: Changbin Du <changbin.du@gmail.com>
    AuthorDate: Sat, 16 Mar 2019 16:05:50 +0800
    Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
    CommitDate: Tue, 19 Mar 2019 16:52:05 -0300

    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 <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>
    ---
    tools/perf/util/map.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
    index fbeb0c6efaa6..64bea5eb8bf6 100644
    --- a/tools/perf/util/map.c
    +++ b/tools/perf/util/map.c
    @@ -917,6 +917,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)
    \
     
     \ /
      Last update: 2019-03-22 23:32    [W:4.097 / U:1.740 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site