diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-07-21 07:24:17 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-29 17:34:44 -0400 |
commit | 38f01d8da1d8d28678ea16a0a484f4d3eded34b2 (patch) | |
tree | 7ab5e39d58a734182355370694e8460418f7a717 /tools/perf/arch | |
parent | 397721e06e52d017cfdd403f63284ed0995d4caf (diff) |
libperf: Add perf_cpu_map__get()/perf_cpu_map__put()
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>
Diffstat (limited to 'tools/perf/arch')
-rw-r--r-- | tools/perf/arch/arm/util/cs-etm.c | 6 | ||||
-rw-r--r-- | tools/perf/arch/arm64/util/header.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 268fcb31cd53..3a78b38e43ca 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c | |||
@@ -181,7 +181,7 @@ static int cs_etm_set_option(struct auxtrace_record *itr, | |||
181 | 181 | ||
182 | err = 0; | 182 | err = 0; |
183 | out: | 183 | out: |
184 | cpu_map__put(online_cpus); | 184 | perf_cpu_map__put(online_cpus); |
185 | return err; | 185 | return err; |
186 | } | 186 | } |
187 | 187 | ||
@@ -517,7 +517,7 @@ cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused, | |||
517 | } | 517 | } |
518 | } | 518 | } |
519 | 519 | ||
520 | cpu_map__put(online_cpus); | 520 | perf_cpu_map__put(online_cpus); |
521 | 521 | ||
522 | return (CS_ETM_HEADER_SIZE + | 522 | return (CS_ETM_HEADER_SIZE + |
523 | (etmv4 * CS_ETMV4_PRIV_SIZE) + | 523 | (etmv4 * CS_ETMV4_PRIV_SIZE) + |
@@ -679,7 +679,7 @@ static int cs_etm_info_fill(struct auxtrace_record *itr, | |||
679 | if (cpu_map__has(cpu_map, i)) | 679 | if (cpu_map__has(cpu_map, i)) |
680 | cs_etm_get_metadata(i, &offset, itr, info); | 680 | cs_etm_get_metadata(i, &offset, itr, info); |
681 | 681 | ||
682 | cpu_map__put(online_cpus); | 682 | perf_cpu_map__put(online_cpus); |
683 | 683 | ||
684 | return 0; | 684 | return 0; |
685 | } | 685 | } |
diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c index b3e73a413f5a..602caf550e7f 100644 --- a/tools/perf/arch/arm64/util/header.c +++ b/tools/perf/arch/arm64/util/header.c | |||
@@ -27,7 +27,7 @@ char *get_cpuid_str(struct perf_pmu *pmu) | |||
27 | return NULL; | 27 | return NULL; |
28 | 28 | ||
29 | /* read midr from list of cpus mapped to this pmu */ | 29 | /* read midr from list of cpus mapped to this pmu */ |
30 | cpus = cpu_map__get(pmu->cpus); | 30 | cpus = perf_cpu_map__get(pmu->cpus); |
31 | for (cpu = 0; cpu < cpus->nr; cpu++) { | 31 | for (cpu = 0; cpu < cpus->nr; cpu++) { |
32 | scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR, | 32 | scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR, |
33 | sysfs, cpus->map[cpu]); | 33 | sysfs, cpus->map[cpu]); |
@@ -60,6 +60,6 @@ char *get_cpuid_str(struct perf_pmu *pmu) | |||
60 | buf = NULL; | 60 | buf = NULL; |
61 | } | 61 | } |
62 | 62 | ||
63 | cpu_map__put(cpus); | 63 | perf_cpu_map__put(cpus); |
64 | return buf; | 64 | return buf; |
65 | } | 65 | } |