lkml.org 
[lkml]   [2019]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 28/63] perf map: Check if the map still has some refcounts on exit
    Date
    From: Arnaldo Carvalho de Melo <acme@redhat.com>

    We were checking just if it was still on some rb tree, but that is not
    the only way that this map can still have references, map->refcnt is
    there exactly for this, use it.

    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lkml.kernel.org/n/tip-hany65tbeavsax7n3xvwl9pc@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    ---
    tools/perf/util/map.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
    index eec9b282c047..c9ba49566981 100644
    --- a/tools/perf/util/map.c
    +++ b/tools/perf/util/map.c
    @@ -288,7 +288,7 @@ bool map__has_symbols(const struct map *map)

    static void map__exit(struct map *map)
    {
    - BUG_ON(!RB_EMPTY_NODE(&map->rb_node));
    + BUG_ON(refcount_read(&map->refcnt) != 0);
    dso__zput(map->dso);
    }

    --
    2.21.0
    \
     
     \ /
      Last update: 2019-11-07 20:05    [W:4.146 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site