summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2023-04-19 10:57:57 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-04-19 12:33:53 -0300
commite1805aae1e0f648351913e7f5a8a7530a90c8634 (patch)
treeb8118620870b722fb3b73d1c203cfeaa6c232ba3 /tools/perf/util/map.c
parent8f12692b7e61e5fb5d3e4f6692d6675f62eeebdc (diff)
downloadlinux-stable-e1805aae1e0f648351913e7f5a8a7530a90c8634.tar.gz
linux-stable-e1805aae1e0f648351913e7f5a8a7530a90c8634.tar.bz2
linux-stable-e1805aae1e0f648351913e7f5a8a7530a90c8634.zip
perf map: Add missing conversions to map__refcnt()
Some conversions weren't performed in 4e8db2d7520f780f ("perf map: Add map__refcnt() accessor to use in the maps test"), fix it. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index d81b6ca18ee9..b6a8935026eb 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -112,7 +112,7 @@ void map__init(struct map *map, u64 start, u64 end, u64 pgoff, struct dso *dso)
map->map_ip = map__dso_map_ip;
map->unmap_ip = map__dso_unmap_ip;
map->erange_warned = false;
- refcount_set(&map->refcnt, 1);
+ refcount_set(map__refcnt(map), 1);
}
struct map *map__new(struct machine *machine, u64 start, u64 len,
@@ -292,7 +292,7 @@ bool map__has_symbols(const struct map *map)
static void map__exit(struct map *map)
{
- BUG_ON(refcount_read(&map->refcnt) != 0);
+ BUG_ON(refcount_read(map__refcnt(map)) != 0);
dso__zput(map->dso);
}
@@ -304,7 +304,7 @@ void map__delete(struct map *map)
void map__put(struct map *map)
{
- if (map && refcount_dec_and_test(&map->refcnt))
+ if (map && refcount_dec_and_test(map__refcnt(map)))
map__delete(map);
}