aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/lib/perf/include
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-04-12 12:54:44 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-04-12 14:44:24 -0300
commit1f94479edb4decdcec3e902528abb47f0ccd5d16 (patch)
tree4db694a633c621e8b106ebc2341bf04344b51fe5 /tools/lib/perf/include
parentperf cpumap: Use perf_cpu_map__nr(cpus) to access cpus->nr (diff)
downloadwireguard-linux-1f94479edb4decdcec3e902528abb47f0ccd5d16.tar.xz
wireguard-linux-1f94479edb4decdcec3e902528abb47f0ccd5d16.zip
libperf: Make perf_cpu_map__alloc() available as an internal function for tools/perf to use
We had the open coded equivalent in perf_cpu_map__empty_new(), so reuse what is in libperf. 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-3-irogers@google.com [ Split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/perf/include')
-rw-r--r--tools/lib/perf/include/internal/cpumap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h
index 35dd29642296..f5bffb1f8674 100644
--- a/tools/lib/perf/include/internal/cpumap.h
+++ b/tools/lib/perf/include/internal/cpumap.h
@@ -24,6 +24,7 @@ struct perf_cpu_map {
#define MAX_NR_CPUS 2048
#endif
+struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus);
int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);