Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __PERF_THREAD_MAP_H |
| 3 | #define __PERF_THREAD_MAP_H |
| 4 | |
| 5 | #include <sys/types.h> |
| 6 | #include <stdio.h> |
| 7 | #include <linux/refcount.h> |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 8 | #include <internal/threadmap.h> |
| 9 | #include <perf/threadmap.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 10 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 11 | struct perf_record_thread_map; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 12 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 13 | struct perf_thread_map *thread_map__new_dummy(void); |
| 14 | struct perf_thread_map *thread_map__new_by_pid(pid_t pid); |
| 15 | struct perf_thread_map *thread_map__new_by_tid(pid_t tid); |
| 16 | struct perf_thread_map *thread_map__new_by_uid(uid_t uid); |
| 17 | struct perf_thread_map *thread_map__new_all_cpus(void); |
| 18 | struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid); |
| 19 | struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 20 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 21 | struct perf_thread_map *thread_map__new_str(const char *pid, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | const char *tid, uid_t uid, bool all_threads); |
| 23 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 24 | struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 25 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 26 | size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 27 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 28 | void thread_map__read_comms(struct perf_thread_map *threads); |
| 29 | bool thread_map__has(struct perf_thread_map *threads, pid_t pid); |
| 30 | int thread_map__remove(struct perf_thread_map *threads, int idx); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 31 | #endif /* __PERF_THREAD_MAP_H */ |