]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
libperf: Add perf_cpu_map__get()/perf_cpu_map__put()
authorJiri Olsa <jolsa@kernel.org>
Sun, 21 Jul 2019 11:24:17 +0000 (13:24 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 29 Jul 2019 21:34:44 +0000 (18:34 -0300)
Moving the following functions:

  cpu_map__get()
  cpu_map__put()

to libperf with following names:

  perf_cpu_map__get()
  perf_cpu_map__put()

Committer notes:

Added fixes for arm/arm64

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-31-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
33 files changed:
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm64/util/header.c
tools/perf/builtin-ftrace.c
tools/perf/builtin-stat.c
tools/perf/lib/cpumap.c
tools/perf/lib/include/perf/cpumap.h
tools/perf/lib/libperf.map
tools/perf/tests/bitmap.c
tools/perf/tests/code-reading.c
tools/perf/tests/cpumap.c
tools/perf/tests/event-times.c
tools/perf/tests/event_update.c
tools/perf/tests/keep-tracking.c
tools/perf/tests/mem2node.c
tools/perf/tests/mmap-basic.c
tools/perf/tests/openat-syscall-all-cpus.c
tools/perf/tests/sw-clock.c
tools/perf/tests/switch-tracking.c
tools/perf/tests/task-exit.c
tools/perf/tests/topology.c
tools/perf/util/cpumap.c
tools/perf/util/cpumap.h
tools/perf/util/cputopo.c
tools/perf/util/env.c
tools/perf/util/event.c
tools/perf/util/evlist.c
tools/perf/util/evsel.c
tools/perf/util/parse-events.c
tools/perf/util/pmu.c
tools/perf/util/python.c
tools/perf/util/record.c
tools/perf/util/session.c
tools/perf/util/svghelper.c

index 268fcb31cd5360337771e111e9e684909e6c5c58..3a78b38e43cacb4e6116a0f231b563391905249e 100644 (file)
@@ -181,7 +181,7 @@ static int cs_etm_set_option(struct auxtrace_record *itr,
 
        err = 0;
 out:
-       cpu_map__put(online_cpus);
+       perf_cpu_map__put(online_cpus);
        return err;
 }
 
@@ -517,7 +517,7 @@ cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused,
                }
        }
 
-       cpu_map__put(online_cpus);
+       perf_cpu_map__put(online_cpus);
 
        return (CS_ETM_HEADER_SIZE +
               (etmv4 * CS_ETMV4_PRIV_SIZE) +
@@ -679,7 +679,7 @@ static int cs_etm_info_fill(struct auxtrace_record *itr,
                if (cpu_map__has(cpu_map, i))
                        cs_etm_get_metadata(i, &offset, itr, info);
 
-       cpu_map__put(online_cpus);
+       perf_cpu_map__put(online_cpus);
 
        return 0;
 }
index b3e73a413f5aa7f60e5879ed559136b4c57a3d21..602caf550e7fc428ab767338329f8bfd6bb120f0 100644 (file)
@@ -27,7 +27,7 @@ char *get_cpuid_str(struct perf_pmu *pmu)
                return NULL;
 
        /* read midr from list of cpus mapped to this pmu */
-       cpus = cpu_map__get(pmu->cpus);
+       cpus = perf_cpu_map__get(pmu->cpus);
        for (cpu = 0; cpu < cpus->nr; cpu++) {
                scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
                                sysfs, cpus->map[cpu]);
@@ -60,6 +60,6 @@ char *get_cpuid_str(struct perf_pmu *pmu)
                buf = NULL;
        }
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        return buf;
 }
index 105ef2a17a9c256c5c86c99cbafd5f62d5a3dee7..6943352b8d9470de3b10583779a3a6fd600e9693 100644 (file)
@@ -206,7 +206,7 @@ static int reset_tracing_cpu(void)
        int ret;
 
        ret = set_tracing_cpumask(cpumap);
-       cpu_map__put(cpumap);
+       perf_cpu_map__put(cpumap);
        return ret;
 }
 
index 36e66a4f3c5736d5afbb1745ee69fb944fb04d80..39bd73d0e06e60896c03a0959b9ccc14fd33ec32 100644 (file)
@@ -933,8 +933,8 @@ static int perf_stat_init_aggr_mode(void)
 
 static void perf_stat__exit_aggr_mode(void)
 {
-       cpu_map__put(stat_config.aggr_map);
-       cpu_map__put(stat_config.cpus_aggr_map);
+       perf_cpu_map__put(stat_config.aggr_map);
+       perf_cpu_map__put(stat_config.cpus_aggr_map);
        stat_config.aggr_map = NULL;
        stat_config.cpus_aggr_map = NULL;
 }
index 80d587ab95aac4a3cd7fb9f6f3cd8ad297a9488e..f3cfb4c71106cdeb4a0df92e939c52816ed99473 100644 (file)
@@ -3,6 +3,8 @@
 #include <stdlib.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+#include <asm/bug.h>
+#include <stdio.h>
 
 struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 {
@@ -16,3 +18,25 @@ struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 
        return cpus;
 }
+
+static void cpu_map__delete(struct perf_cpu_map *map)
+{
+       if (map) {
+               WARN_ONCE(refcount_read(&map->refcnt) != 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);
+       return map;
+}
+
+void perf_cpu_map__put(struct perf_cpu_map *map)
+{
+       if (map && refcount_dec_and_test(&map->refcnt))
+               cpu_map__delete(map);
+}
index fa1e5aa9d6623fade3a333cac4e1db3f77286631..e16c2515a4992f177fb996399354a93303d73727 100644 (file)
@@ -7,5 +7,7 @@
 struct perf_cpu_map;
 
 LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
+LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
 
 #endif /* __LIBPERF_CPUMAP_H */
index 65201c6cbe7e9a648eb4db50a8c57126e1740217..76ce3bc59dd81e28e3488a38feee381c33b280c0 100644 (file)
@@ -2,6 +2,8 @@ LIBPERF_0.0.1 {
        global:
                libperf_set_print;
                perf_cpu_map__dummy_new;
+               perf_cpu_map__get;
+               perf_cpu_map__put;
        local:
                *;
 };
index 74d0cd32a5c4fd6b0995e31c24d3480a2184a7de..95304d29092e80a4290923df010eec0460f38a60 100644 (file)
@@ -21,7 +21,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
        }
 
        if (map)
-               cpu_map__put(map);
+               perf_cpu_map__put(map);
        return bm;
 }
 
index ec4b0bf28270d11bcfa407a8d50f3982b07fb1f7..ce2d3266286abe242ce1934961a75df4a582bf97 100644 (file)
@@ -655,7 +655,7 @@ static int do_test_code_reading(bool try_kcore)
                                 * and will be freed by following perf_evlist__set_maps
                                 * call. Getting refference to keep them alive.
                                 */
-                               cpu_map__get(cpus);
+                               perf_cpu_map__get(cpus);
                                thread_map__get(threads);
                                perf_evlist__set_maps(evlist, NULL, NULL);
                                evlist__delete(evlist);
@@ -705,7 +705,7 @@ out_err:
        if (evlist) {
                evlist__delete(evlist);
        } else {
-               cpu_map__put(cpus);
+               perf_cpu_map__put(cpus);
                thread_map__put(threads);
        }
        machine__delete_threads(machine);
index 10da4400493d134f753e5be2738c45b69bc45b8e..6c921087b0fe8edc02da2d07eaf9a3430914e5db 100644 (file)
@@ -39,7 +39,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
                TEST_ASSERT_VAL("wrong cpu", map->map[i] == i);
        }
 
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
        return 0;
 }
 
@@ -68,7 +68,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
        TEST_ASSERT_VAL("wrong cpu", map->map[0] == 1);
        TEST_ASSERT_VAL("wrong cpu", map->map[1] == 256);
        TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
        return 0;
 }
 
@@ -83,7 +83,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
        TEST_ASSERT_VAL("failed to synthesize map",
                !perf_event__synthesize_cpu_map(NULL, cpus, process_event_mask, NULL));
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 
        /* This one is better stores in cpu values. */
        cpus = cpu_map__new("1,256");
@@ -91,7 +91,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
        TEST_ASSERT_VAL("failed to synthesize map",
                !perf_event__synthesize_cpu_map(NULL, cpus, process_event_cpus, NULL));
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        return 0;
 }
 
index bf00d3d792fb65beb41ba891eb7cbacba936e96c..dcfff4b20c926b3dab4dbb6e5021cb7ae5934d78 100644 (file)
@@ -132,7 +132,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
                return err;
        }
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        return evsel__enable(evsel);
 }
 
@@ -154,7 +154,7 @@ static int attach__cpu_enabled(struct evlist *evlist)
        if (err == -EACCES)
                return TEST_SKIP;
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        return err ? TEST_FAIL : TEST_OK;
 }
 
index eb0dd359762da36ae10e21c01a715d28b3ef31d6..415d12e96834d5c12789fd74e874408d104e2378 100644 (file)
@@ -73,7 +73,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
        TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1);
        TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
        TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
        return 0;
 }
 
@@ -113,6 +113,6 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu
        TEST_ASSERT_VAL("failed to synthesize attr update cpus",
                        !perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus));
 
-       cpu_map__put(evsel->own_cpus);
+       perf_cpu_map__put(evsel->own_cpus);
        return 0;
 }
index 7bfc859971e58df6e3b2d4e2403b1d3ad122c38e..43e55fe98f8c21e24a677ec20f40c91878defa97 100644 (file)
@@ -149,7 +149,7 @@ out_err:
                evlist__disable(evlist);
                evlist__delete(evlist);
        } else {
-               cpu_map__put(cpus);
+               perf_cpu_map__put(cpus);
                thread_map__put(threads);
        }
 
index e12eedfba781336a390be75240b4c069097b1ade..6fe2c1e7918be34e79b34fb929b0749eda32dc06 100644 (file)
@@ -32,7 +32,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
        }
 
        if (map)
-               cpu_map__put(map);
+               perf_cpu_map__put(map);
        else
                free(bm);
 
index 40511025208f97920b4c37f451b782322f84395d..d15282174b2e82c50c1a0a0b9a95bda589321980 100644 (file)
@@ -155,7 +155,7 @@ out_delete_evlist:
        cpus    = NULL;
        threads = NULL;
 out_free_cpus:
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 out_free_threads:
        thread_map__put(threads);
        return err;
index f96cbd30402454c81666c200b03768ebc338bb85..611f6ea9b702e71b17345106df452586661c4414 100644 (file)
@@ -120,7 +120,7 @@ out_close_fd:
 out_evsel_delete:
        evsel__delete(evsel);
 out_cpu_map_delete:
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 out_thread_map_delete:
        thread_map__put(threads);
        return err;
index c6d3f4488b735868ce40b6eedca0555d78485a74..c464e301ade9c4de5c16959d320524432719c640 100644 (file)
@@ -125,7 +125,7 @@ out_init:
        }
 
 out_free_maps:
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        thread_map__put(threads);
 out_delete_evlist:
        evlist__delete(evlist);
index d5537edb47db19811bc07f23785c42de97d402ae..27af7b7109a3c9006442f49512089f806f7b8ea4 100644 (file)
@@ -569,7 +569,7 @@ out:
                evlist__disable(evlist);
                evlist__delete(evlist);
        } else {
-               cpu_map__put(cpus);
+               perf_cpu_map__put(cpus);
                thread_map__put(threads);
        }
 
index c094fb8cc8776d95a42ff8e1cf0b93d9ee638b10..f026759a05d7b290a09cd02972626b2e08c8e1e7 100644 (file)
@@ -135,7 +135,7 @@ out_init:
        }
 
 out_free_maps:
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        thread_map__put(threads);
 out_delete_evlist:
        evlist__delete(evlist);
index 443d0272ebbde65d75df2e2e2d1e6aa6bdca633e..1b57ded58d594c6a84b50796981b54f481098c5a 100644 (file)
@@ -133,7 +133,7 @@ int test__session_topology(struct test *test __maybe_unused, int subtest __maybe
        }
 
        ret = check_cpu_topology(path, map);
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
 
 free_path:
        unlink(path);
index acda9bfb40020d0edccfe684e647f2c4d787b87a..44082e5eabdea32bb7cb6ce0b44c54c2a39df664 100644 (file)
@@ -273,28 +273,6 @@ struct perf_cpu_map *cpu_map__empty_new(int nr)
        return cpus;
 }
 
-static void cpu_map__delete(struct perf_cpu_map *map)
-{
-       if (map) {
-               WARN_ONCE(refcount_read(&map->refcnt) != 0,
-                         "cpu_map refcnt unbalanced\n");
-               free(map);
-       }
-}
-
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map)
-{
-       if (map)
-               refcount_inc(&map->refcnt);
-       return map;
-}
-
-void cpu_map__put(struct perf_cpu_map *map)
-{
-       if (map && refcount_dec_and_test(&map->refcnt))
-               cpu_map__delete(map);
-}
-
 static int cpu__get_topology_int(int cpu, const char *name, int *value)
 {
        char path[PATH_MAX];
index 0ce3f6bd944900f3517a1a6398153e2ca44a0e10..b7af2cb68c1948276e325a8dfa7b86d6ed7bb6cc 100644 (file)
@@ -29,9 +29,6 @@ int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct perf_cpu_map **diep
 int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep);
 const struct perf_cpu_map *cpu_map__online(void); /* thread unsafe */
 
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map);
-void cpu_map__put(struct perf_cpu_map *map);
-
 static inline int cpu_map__socket(struct perf_cpu_map *sock, int s)
 {
        if (!sock || s > sock->nr || s < 0)
index 157b0988435e39772c46e61f9bae8c1329aaf5b4..0cd99c460cd4740036221524fd1515c6f9ad19d1 100644 (file)
@@ -219,7 +219,7 @@ struct cpu_topology *cpu_topology__new(void)
        }
 
 out_free:
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
        if (ret) {
                cpu_topology__delete(tp);
                tp = NULL;
@@ -335,7 +335,7 @@ struct numa_topology *numa_topology__new(void)
 out:
        free(buf);
        fclose(fp);
-       cpu_map__put(node_map);
+       perf_cpu_map__put(node_map);
        return tp;
 }
 
index 9909ec40c6d2d164a56e7605da47124116b6bee1..d77912b2b5e725ab64de2634794eed82a9908cb0 100644 (file)
@@ -179,7 +179,7 @@ void perf_env__exit(struct perf_env *env)
        zfree(&env->cpu);
 
        for (i = 0; i < env->nr_numa_nodes; i++)
-               cpu_map__put(env->numa_nodes[i].map);
+               perf_cpu_map__put(env->numa_nodes[i].map);
        zfree(&env->numa_nodes);
 
        for (i = 0; i < env->caches_cnt; i++)
index f78837788b145bba036c854f0a95444ccc341e27..1a3db35f9f7d56ffa3c9ffe7f6cca80207a830b6 100644 (file)
@@ -1403,7 +1403,7 @@ size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp)
        else
                ret += fprintf(fp, "failed to get cpumap from event\n");
 
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        return ret;
 }
 
index 461c1e68e9e7d92d5700776e0a3c8c8ae542bb5b..35020d50f51e37e45eb54c94c5322c08fbc79f2e 100644 (file)
@@ -141,7 +141,7 @@ void evlist__delete(struct evlist *evlist)
 
        perf_evlist__munmap(evlist);
        evlist__close(evlist);
-       cpu_map__put(evlist->cpus);
+       perf_cpu_map__put(evlist->cpus);
        thread_map__put(evlist->threads);
        evlist->cpus = NULL;
        evlist->threads = NULL;
@@ -158,11 +158,11 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
         * keep it, if there's no target cpu list defined.
         */
        if (!evsel->own_cpus || evlist->has_user_cpus) {
-               cpu_map__put(evsel->cpus);
-               evsel->cpus = cpu_map__get(evlist->cpus);
+               perf_cpu_map__put(evsel->cpus);
+               evsel->cpus = perf_cpu_map__get(evlist->cpus);
        } else if (evsel->cpus != evsel->own_cpus) {
-               cpu_map__put(evsel->cpus);
-               evsel->cpus = cpu_map__get(evsel->own_cpus);
+               perf_cpu_map__put(evsel->cpus);
+               evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
        }
 
        thread_map__put(evsel->threads);
@@ -1115,8 +1115,8 @@ void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
         * the caller to increase the reference count.
         */
        if (cpus != evlist->cpus) {
-               cpu_map__put(evlist->cpus);
-               evlist->cpus = cpu_map__get(cpus);
+               perf_cpu_map__put(evlist->cpus);
+               evlist->cpus = perf_cpu_map__get(cpus);
        }
 
        if (threads != evlist->threads) {
@@ -1383,7 +1383,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 out:
        return err;
 out_put:
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
        goto out;
 }
 
index a389752840a9bc76a5e35041814233c8e0e6af32..72c0e6948e832ec7a9ed591254d6e99e46c44ae8 100644 (file)
@@ -1325,8 +1325,8 @@ void perf_evsel__exit(struct evsel *evsel)
        perf_evsel__free_id(evsel);
        perf_evsel__free_config_terms(evsel);
        cgroup__put(evsel->cgrp);
-       cpu_map__put(evsel->cpus);
-       cpu_map__put(evsel->own_cpus);
+       perf_cpu_map__put(evsel->cpus);
+       perf_cpu_map__put(evsel->own_cpus);
        thread_map__put(evsel->threads);
        zfree(&evsel->group_name);
        zfree(&evsel->name);
index decb66d243ca714acb652dd907898a87aa9be89d..8c9928feb38a1666b9c8bec5a4f93a5f848261c7 100644 (file)
@@ -332,8 +332,8 @@ __add_event(struct list_head *list, int *idx,
                return NULL;
 
        (*idx)++;
-       evsel->cpus        = cpu_map__get(cpus);
-       evsel->own_cpus    = cpu_map__get(cpus);
+       evsel->cpus        = perf_cpu_map__get(cpus);
+       evsel->own_cpus    = perf_cpu_map__get(cpus);
        evsel->system_wide = pmu ? pmu->is_uncore : false;
        evsel->auto_merge_stats = auto_merge_stats;
 
index 4929a50c0973dca6a571bee4ddb78012e97fbffe..d355f9506a1c26b0e50d7a419830fc277ea428a1 100644 (file)
@@ -626,7 +626,7 @@ static bool pmu_is_uncore(const char *name)
 
        snprintf(path, PATH_MAX, CPUS_TEMPLATE_UNCORE, sysfs, name);
        cpus = __pmu_cpumask(path);
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 
        return !!cpus;
 }
index cc4af99ab190f4a39efed009dae34c338154da7f..677c93f91c6c14358bad64902993279784963565 100644 (file)
@@ -557,7 +557,7 @@ static int pyrf_cpu_map__init(struct pyrf_cpu_map *pcpus,
 
 static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus)
 {
-       cpu_map__put(pcpus->cpus);
+       perf_cpu_map__put(pcpus->cpus);
        Py_TYPE(pcpus)->tp_free((PyObject*)pcpus);
 }
 
index 9f8841548539dcb1b4c1103f445528b7d4447e01..fecccfd71aa1ae6d7287486a78e1d897ea1f336f 100644 (file)
@@ -67,7 +67,7 @@ static bool perf_probe_api(setup_probe_fn_t fn)
        if (!cpus)
                return false;
        cpu = cpus->map[0];
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 
        do {
                ret = perf_do_probe_api(fn, cpu, try[i++]);
@@ -122,7 +122,7 @@ bool perf_can_record_cpu_wide(void)
        if (!cpus)
                return false;
        cpu = cpus->map[0];
-       cpu_map__put(cpus);
+       perf_cpu_map__put(cpus);
 
        fd = sys_perf_event_open(&attr, -1, cpu, -1, 0);
        if (fd < 0)
@@ -278,7 +278,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
                struct perf_cpu_map *cpus = cpu_map__new(NULL);
 
                cpu =  cpus ? cpus->map[0] : 0;
-               cpu_map__put(cpus);
+               perf_cpu_map__put(cpus);
        } else {
                cpu = evlist->cpus->map[0];
        }
index c191dc1521757b4e00d39049bc84f8ca42c7f1c0..62d37440cbeec37263ad54ab65df3f7ffe66efde 100644 (file)
@@ -2310,7 +2310,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
        err = 0;
 
 out_delete_map:
-       cpu_map__put(map);
+       perf_cpu_map__put(map);
        return err;
 }
 
index 99132c6a30a6721bdae9f494726ddeb028b61b05..a9ca5c4fffeed0016fa1bbe43bc7a45fcafca994 100644 (file)
@@ -745,7 +745,7 @@ static int str_to_bitmap(char *s, cpumask_t *b)
                set_bit(c, cpumask_bits(b));
        }
 
-       cpu_map__put(m);
+       perf_cpu_map__put(m);
 
        return ret;
 }