summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-04-19 10:48:37 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-04-19 10:53:01 -0300
commit8f12692b7e61e5fb5d3e4f6692d6675f62eeebdc (patch)
treec3c653ed2524b984c7b4ae279d6a096f344fd569 /tools/perf/util/map.c
parenta07dacad8ac40d1beadb640fe341b5198c1cf097 (diff)
downloadlinux-stable-8f12692b7e61e5fb5d3e4f6692d6675f62eeebdc.tar.gz
linux-stable-8f12692b7e61e5fb5d3e4f6692d6675f62eeebdc.tar.bz2
linux-stable-8f12692b7e61e5fb5d3e4f6692d6675f62eeebdc.zip
perf maps: Add reference count checking
Add reference count checking to make sure of good use of get and put. Add and use accessors to reduce RC_CHK clutter. The only significant issue was in tests/thread-maps-share.c where reference counts were released in the reverse order to acquisition, leading to a use after put. This was fixed by reversing the put order. Committer notes: Extracted from a larger patch removing bits that were covered by the use of pre-existing maps__ accessors (e.g. maps__nr_maps()) and new ones added (maps__refcnt()) to reduce RC_CHK_ACCESS(maps)-> source code pollution. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Dmitriy Vyukov <dvyukov@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/20230407230405.2931830-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.c')
0 files changed, 0 insertions, 0 deletions