aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/include/internal/threadmap.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-21 07:24:18 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-29 17:34:44 -0400
commit07acd22677ac6bb2db404d1d258e8c7d06ca7706 (patch)
tree1556201b9719083eee95c9fa6c66696ba432f6b7 /tools/perf/lib/include/internal/threadmap.h
parent38f01d8da1d8d28678ea16a0a484f4d3eded34b2 (diff)
libperf: Add perf_thread_map struct
Add perf_thread_map struct to libperf. It's added as a declaration into into: include/perf/threadmap.h which will be included by users. The perf_thread_map struct definition is added into: include/internal/threadmap.h which is not to be included by users, but shared within perf and libperf. We tried the total separation of the perf_thread_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration. 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-32-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib/include/internal/threadmap.h')
-rw-r--r--tools/perf/lib/include/internal/threadmap.h21
1 files changed, 21 insertions, 0 deletions
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 */