blob: 3bb860a32b8e9253a7bb29ea9b58fb6eacabefd8 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* 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 Brazdil0f672f62019-12-10 10:32:29 +00008#include <internal/threadmap.h>
9#include <perf/threadmap.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010
David Brazdil0f672f62019-12-10 10:32:29 +000011struct perf_record_thread_map;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000012
David Brazdil0f672f62019-12-10 10:32:29 +000013struct perf_thread_map *thread_map__new_dummy(void);
14struct perf_thread_map *thread_map__new_by_pid(pid_t pid);
15struct perf_thread_map *thread_map__new_by_tid(pid_t tid);
16struct perf_thread_map *thread_map__new_by_uid(uid_t uid);
17struct perf_thread_map *thread_map__new_all_cpus(void);
18struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
19struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000020
David Brazdil0f672f62019-12-10 10:32:29 +000021struct perf_thread_map *thread_map__new_str(const char *pid,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022 const char *tid, uid_t uid, bool all_threads);
23
David Brazdil0f672f62019-12-10 10:32:29 +000024struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025
David Brazdil0f672f62019-12-10 10:32:29 +000026size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000027
David Brazdil0f672f62019-12-10 10:32:29 +000028void thread_map__read_comms(struct perf_thread_map *threads);
29bool thread_map__has(struct perf_thread_map *threads, pid_t pid);
30int thread_map__remove(struct perf_thread_map *threads, int idx);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000031#endif /* __PERF_THREAD_MAP_H */