blob: 95313f43cc0ffe5280b19a54fc9925ec4b83c498 [file] [log] [blame]
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -02001#ifndef __PERF_THREAD_MAP_H
2#define __PERF_THREAD_MAP_H
3
4#include <sys/types.h>
Arnaldo Carvalho de Melo9ae7d332012-01-19 14:07:23 -02005#include <stdio.h>
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -02006
7struct thread_map {
8 int nr;
Robert Richter61d5bf52012-04-05 18:26:26 +02009 pid_t map[];
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -020010};
11
Arnaldo Carvalho de Melo641556c2014-10-10 12:03:46 -030012struct thread_map *thread_map__new_dummy(void);
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -020013struct thread_map *thread_map__new_by_pid(pid_t pid);
14struct thread_map *thread_map__new_by_tid(pid_t tid);
Arnaldo Carvalho de Melo0d37aa32012-01-19 14:08:15 -020015struct thread_map *thread_map__new_by_uid(uid_t uid);
16struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
David Ahernb52956c2012-02-08 09:32:52 -070017
18struct thread_map *thread_map__new_str(const char *pid,
19 const char *tid, uid_t uid);
20
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -020021void thread_map__delete(struct thread_map *threads);
Arnaldo Carvalho de Melo9ae7d332012-01-19 14:07:23 -020022
23size_t thread_map__fprintf(struct thread_map *threads, FILE *fp);
24
Namhyung Kimb3a319d2013-03-11 16:43:14 +090025static inline int thread_map__nr(struct thread_map *threads)
26{
27 return threads ? threads->nr : 1;
28}
29
Arnaldo Carvalho de Melofd782602011-01-18 15:15:24 -020030#endif /* __PERF_THREAD_MAP_H */