aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/lib/Build1
-rw-r--r--tools/perf/lib/include/internal/threadmap.h21
-rw-r--r--tools/perf/lib/include/perf/threadmap.h7
-rw-r--r--tools/perf/lib/threadmap.c5
-rw-r--r--tools/perf/util/thread_map.h13
5 files changed, 35 insertions, 12 deletions
diff --git a/tools/perf/lib/Build b/tools/perf/lib/Build
index 195b274db49a..9beadfc81a71 100644
--- a/tools/perf/lib/Build
+++ b/tools/perf/lib/Build
@@ -1,2 +1,3 @@
1libperf-y += core.o 1libperf-y += core.o
2libperf-y += cpumap.o 2libperf-y += cpumap.o
3libperf-y += threadmap.o
diff --git a/tools/perf/lib/include/internal/threadmap.h b/tools/perf/lib/include/internal/threadmap.h
new file mode 100644
index 000000000000..c8088005a9ab
--- /dev/null
+++ b/tools/perf/lib/include/internal/threadmap.h
@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LIBPERF_INTERNAL_THREADMAP_H
3#define __LIBPERF_INTERNAL_THREADMAP_H
4
5#include <linux/refcount.h>
6#include <sys/types.h>
7#include <unistd.h>
8
9struct thread_map_data {
10 pid_t pid;
11 char *comm;
12};
13
14struct perf_thread_map {
15 refcount_t refcnt;
16 int nr;
17 int err_thread;
18 struct thread_map_data map[];
19};
20
21#endif /* __LIBPERF_INTERNAL_THREADMAP_H */
diff --git a/tools/perf/lib/include/perf/threadmap.h b/tools/perf/lib/include/perf/threadmap.h
new file mode 100644
index 000000000000..dc3a3837b56f
--- /dev/null
+++ b/tools/perf/lib/include/perf/threadmap.h
@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LIBPERF_THREADMAP_H
3#define __LIBPERF_THREADMAP_H
4
5struct perf_thread_map;
6
7#endif /* __LIBPERF_THREADMAP_H */
diff --git a/tools/perf/lib/threadmap.c b/tools/perf/lib/threadmap.c
new file mode 100644
index 000000000000..163dc609b909
--- /dev/null
+++ b/tools/perf/lib/threadmap.c
@@ -0,0 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <perf/threadmap.h>
3#include <stdlib.h>
4#include <linux/refcount.h>
5#include <internal/threadmap.h>
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h
index 9358b1b6e657..5a7be6f8934f 100644
--- a/tools/perf/util/thread_map.h
+++ b/tools/perf/util/thread_map.h
@@ -5,18 +5,7 @@
5#include <sys/types.h> 5#include <sys/types.h>
6#include <stdio.h> 6#include <stdio.h>
7#include <linux/refcount.h> 7#include <linux/refcount.h>
8 8#include <internal/threadmap.h>
9struct thread_map_data {
10 pid_t pid;
11 char *comm;
12};
13
14struct perf_thread_map {
15 refcount_t refcnt;
16 int nr;
17 int err_thread;
18 struct thread_map_data map[];
19};
20 9
21struct thread_map_event; 10struct thread_map_event;
22 11