static void cpu_map__delete(struct perf_cpu_map *map)
 {
        if (map) {
-               WARN_ONCE(refcount_read(&map->refcnt) != 0,
+               WARN_ONCE(refcount_read(perf_cpu_map__refcnt(map)) != 0,
                          "cpu_map refcnt unbalanced\n");
                free(map);
        }
 struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
 {
        if (map)
-               refcount_inc(&map->refcnt);
+               refcount_inc(perf_cpu_map__refcnt(map));
        return map;
 }
 
 void perf_cpu_map__put(struct perf_cpu_map *map)
 {
-       if (map && refcount_dec_and_test(&map->refcnt))
+       if (map && refcount_dec_and_test(perf_cpu_map__refcnt(map)))
                cpu_map__delete(map);
 }
 
 
 
 void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus);
 
+static inline refcount_t *perf_cpu_map__refcnt(struct perf_cpu_map *map)
+{
+       return &map->refcnt;
+}
 #endif /* __LIBPERF_INTERNAL_CPUMAP_H */
 
        TEST_ASSERT_VAL("wrong nr",  perf_cpu_map__nr(map) == 2);
        TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 0).cpu == 1);
        TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 1).cpu == 256);
-       TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
+       TEST_ASSERT_VAL("wrong refcnt", refcount_read(perf_cpu_map__refcnt(map)) == 1);
        perf_cpu_map__put(map);
        return 0;
 }
        TEST_ASSERT_VAL("wrong nr",  perf_cpu_map__nr(map) == 256);
        TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 0).cpu == 1);
        TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__max(map).cpu == 256);
-       TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
+       TEST_ASSERT_VAL("wrong refcnt", refcount_read(perf_cpu_map__refcnt(map)) == 1);
        perf_cpu_map__put(map);
        return 0;
 }