perf map: Add map__refcnt() accessor to use in the maps test
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 15:36:58 +0000 (12:36 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 15:49:16 +0000 (12:49 -0300)
commit4e8db2d7520f780f86055465c680e20327008a34
treef357bfc617432f8cb6f3a5e29a9b500b34d3ddc0
parent984abd349d0f76d4b267abc0d8e1a86af3ec2d84
perf map: Add map__refcnt() accessor to use in the maps test

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

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Riccardo Mancini <rickyman7@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Link: https://lore.kernel.org/lkml/ZDbRIJknafLnDwtO@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/maps.c
tools/perf/util/map.h