提交 07acd226 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

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: NJiri 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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 38f01d8d
libperf-y += core.o libperf-y += core.o
libperf-y += cpumap.o libperf-y += cpumap.o
libperf-y += threadmap.o
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LIBPERF_INTERNAL_THREADMAP_H
#define __LIBPERF_INTERNAL_THREADMAP_H
#include <linux/refcount.h>
#include <sys/types.h>
#include <unistd.h>
struct thread_map_data {
pid_t pid;
char *comm;
};
struct perf_thread_map {
refcount_t refcnt;
int nr;
int err_thread;
struct thread_map_data map[];
};
#endif /* __LIBPERF_INTERNAL_THREADMAP_H */
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LIBPERF_THREADMAP_H
#define __LIBPERF_THREADMAP_H
struct perf_thread_map;
#endif /* __LIBPERF_THREADMAP_H */
// SPDX-License-Identifier: GPL-2.0
#include <perf/threadmap.h>
#include <stdlib.h>
#include <linux/refcount.h>
#include <internal/threadmap.h>
...@@ -5,18 +5,7 @@ ...@@ -5,18 +5,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <linux/refcount.h> #include <linux/refcount.h>
#include <internal/threadmap.h>
struct thread_map_data {
pid_t pid;
char *comm;
};
struct perf_thread_map {
refcount_t refcnt;
int nr;
int err_thread;
struct thread_map_data map[];
};
struct thread_map_event; struct thread_map_event;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册