perf maps: Add maps__refcnt() accessor to allow checking maps pointer
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 18 Apr 2023 20:33:48 +0000 (17:33 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Apr 2023 13:52:54 +0000 (10:52 -0300)
commitfe693d951e3c303b4fb6c712f8affecbe9e8b001
tree8e38165abc611742b25d7a1f2bfed3406c361193
parent3ad1be6faef9a482c3098928220fcafaa51a1283
perf maps: Add maps__refcnt() accessor to allow checking maps pointer

To remove one more direct access to 'struct maps' so that we can
intercept accesses to its instantiations and refcount check it to catch
use after free, etc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/thread-maps-share.c
tools/perf/util/maps.c
tools/perf/util/maps.h