Ian Rogers 8f12692b7e 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>
2023-04-19 10:53:01 -03:00
..
2023-04-04 16:41:57 -03:00
2023-04-04 16:41:57 -03:00
2022-01-12 17:01:38 -08:00
2023-04-04 16:41:57 -03:00
2022-06-28 12:05:25 -03:00
2023-04-04 16:41:57 -03:00
2023-03-14 08:29:46 -03:00
2022-10-04 08:55:21 -03:00
2023-02-19 08:10:25 -03:00
2021-04-29 10:30:58 -03:00
2023-04-04 16:41:57 -03:00
2021-08-11 09:35:44 -03:00
2023-03-13 17:42:27 -03:00
2023-01-23 10:00:47 -03:00
2023-02-19 08:06:59 -03:00
2023-03-13 17:42:27 -03:00
2023-03-20 19:28:21 -03:00
2021-11-07 12:27:38 -03:00
2021-02-03 13:10:44 -03:00
2023-04-04 13:23:59 -03:00
2021-07-15 17:30:22 -03:00
2023-04-06 22:13:43 -03:00
2023-04-19 10:53:01 -03:00
2023-04-19 10:53:01 -03:00
2023-03-13 17:42:27 -03:00
2023-04-06 21:40:28 -03:00
2023-04-06 21:40:28 -03:00
2022-12-14 15:28:18 -03:00
2023-03-20 19:28:21 -03:00
2023-03-13 15:12:31 -03:00
2020-10-14 13:34:26 -03:00
2021-02-17 15:15:06 -03:00
2022-06-23 11:54:22 -03:00
2022-10-04 08:55:20 -03:00
2023-04-10 19:20:53 -03:00
2023-04-10 19:21:31 -03:00
2023-04-04 16:41:57 -03:00