xref: /OK3568_Linux_fs/kernel/tools/perf/util/thread_map.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef __PERF_THREAD_MAP_H
3*4882a593Smuzhiyun #define __PERF_THREAD_MAP_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <sys/types.h>
6*4882a593Smuzhiyun #include <stdio.h>
7*4882a593Smuzhiyun #include <linux/refcount.h>
8*4882a593Smuzhiyun #include <internal/threadmap.h>
9*4882a593Smuzhiyun #include <perf/threadmap.h>
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun struct perf_record_thread_map;
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_dummy(void);
14*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_by_pid(pid_t pid);
15*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_by_tid(pid_t tid);
16*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_by_uid(uid_t uid);
17*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_all_cpus(void);
18*4882a593Smuzhiyun struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
19*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event);
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_str(const char *pid,
22*4882a593Smuzhiyun 		const char *tid, uid_t uid, bool all_threads);
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str);
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp);
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun void thread_map__read_comms(struct perf_thread_map *threads);
29*4882a593Smuzhiyun bool thread_map__has(struct perf_thread_map *threads, pid_t pid);
30*4882a593Smuzhiyun int thread_map__remove(struct perf_thread_map *threads, int idx);
31*4882a593Smuzhiyun #endif	/* __PERF_THREAD_MAP_H */
32