perf map: Check if the map still has some refcounts on exit
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 25 Oct 2019 18:14:50 +0000 (15:14 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Nov 2019 18:43:06 +0000 (15:43 -0300)
commitee2555b612869a763563c5389ad789a52db0afd1
treef7218056fe47ed6db143278f63d65dc1bad1a049
parentb86a9d918a389162803d833d4dc491fde9b62fa2
perf map: Check if the map still has some refcounts on exit

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