summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/lib/Build1
-rw-r--r--tools/perf/lib/cpumap.c5
-rw-r--r--tools/perf/lib/include/internal/cpumap.h13
-rw-r--r--tools/perf/lib/include/perf/cpumap.h7
-rw-r--r--tools/perf/util/cpumap.h7
5 files changed, 27 insertions, 6 deletions
diff --git a/tools/perf/lib/Build b/tools/perf/lib/Build
index 5196958cec01..195b274db49a 100644
--- a/tools/perf/lib/Build
+++ b/tools/perf/lib/Build
@@ -1 +1,2 @@
libperf-y += core.o
+libperf-y += cpumap.o
diff --git a/tools/perf/lib/cpumap.c b/tools/perf/lib/cpumap.c
new file mode 100644
index 000000000000..86a199c26f20
--- /dev/null
+++ b/tools/perf/lib/cpumap.c
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <perf/cpumap.h>
+#include <stdlib.h>
+#include <linux/refcount.h>
+#include <internal/cpumap.h>
diff --git a/tools/perf/lib/include/internal/cpumap.h b/tools/perf/lib/include/internal/cpumap.h
new file mode 100644
index 000000000000..53ce95374b05
--- /dev/null
+++ b/tools/perf/lib/include/internal/cpumap.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_CPUMAP_H
+#define __LIBPERF_INTERNAL_CPUMAP_H
+
+#include <linux/refcount.h>
+
+struct perf_cpu_map {
+ refcount_t refcnt;
+ int nr;
+ int map[];
+};
+
+#endif /* __LIBPERF_INTERNAL_CPUMAP_H */
diff --git a/tools/perf/lib/include/perf/cpumap.h b/tools/perf/lib/include/perf/cpumap.h
new file mode 100644
index 000000000000..8355d3ce7d0c
--- /dev/null
+++ b/tools/perf/lib/include/perf/cpumap.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_CPUMAP_H
+#define __LIBPERF_CPUMAP_H
+
+struct perf_cpu_map;
+
+#endif /* __LIBPERF_CPUMAP_H */
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h
index 22729beae959..c2ba9ae195f7 100644
--- a/tools/perf/util/cpumap.h
+++ b/tools/perf/util/cpumap.h
@@ -5,16 +5,11 @@
#include <stdio.h>
#include <stdbool.h>
#include <linux/refcount.h>
+#include <internal/cpumap.h>
#include "perf.h"
#include "util/debug.h"
-struct perf_cpu_map {
- refcount_t refcnt;
- int nr;
- int map[];
-};
-
struct perf_cpu_map *cpu_map__new(const char *cpu_list);
struct perf_cpu_map *cpu_map__empty_new(int nr);
struct perf_cpu_map *cpu_map__dummy_new(void);