M7350/kernel/tools/perf/util/thread_map.h

31 lines
770 B
C
Raw Permalink Normal View History

2024-09-09 08:52:07 +00:00
#ifndef __PERF_THREAD_MAP_H
#define __PERF_THREAD_MAP_H
#include <sys/types.h>
#include <stdio.h>
struct thread_map {
int nr;
2024-09-09 08:57:42 +00:00
pid_t map[];
2024-09-09 08:52:07 +00:00
};
2024-09-09 08:57:42 +00:00
struct thread_map *thread_map__new_dummy(void);
2024-09-09 08:52:07 +00:00
struct thread_map *thread_map__new_by_pid(pid_t pid);
struct thread_map *thread_map__new_by_tid(pid_t tid);
struct thread_map *thread_map__new_by_uid(uid_t uid);
struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
struct thread_map *thread_map__new_str(const char *pid,
const char *tid, uid_t uid);
void thread_map__delete(struct thread_map *threads);
size_t thread_map__fprintf(struct thread_map *threads, FILE *fp);
2024-09-09 08:57:42 +00:00
static inline int thread_map__nr(struct thread_map *threads)
{
return threads ? threads->nr : 1;
}
2024-09-09 08:52:07 +00:00
#endif /* __PERF_THREAD_MAP_H */