1 #ifndef __PERF_THREAD_H
2 #define __PERF_THREAD_H
3
4 /* ANDROID_CHANGE_BEGIN */
5 #if 0
6 #include <linux/rbtree.h>
7 #else
8 #include "include/linux/rbtree.h"
9 #endif
10 /* ANDROID_CHANGE_END */
11 #include <unistd.h>
12 #include "symbol.h"
13
14 struct thread {
15 union {
16 struct rb_node rb_node;
17 struct list_head node;
18 };
19 struct map_groups mg;
20 pid_t pid;
21 char shortname[3];
22 bool comm_set;
23 char *comm;
24 int comm_len;
25 };
26
27 struct perf_session;
28
29 void thread__delete(struct thread *self);
30
31 int thread__set_comm(struct thread *self, const char *comm);
32 int thread__comm_len(struct thread *self);
33 struct thread *perf_session__findnew(struct perf_session *self, pid_t pid);
34 void thread__insert_map(struct thread *self, struct map *map);
35 int thread__fork(struct thread *self, struct thread *parent);
36 size_t perf_session__fprintf(struct perf_session *self, FILE *fp);
37
thread__find_map(struct thread * self,enum map_type type,u64 addr)38 static inline struct map *thread__find_map(struct thread *self,
39 enum map_type type, u64 addr)
40 {
41 return self ? map_groups__find(&self->mg, type, addr) : NULL;
42 }
43
44 void thread__find_addr_map(struct thread *self,
45 struct perf_session *session, u8 cpumode,
46 enum map_type type, pid_t pid, u64 addr,
47 struct addr_location *al);
48
49 void thread__find_addr_location(struct thread *self,
50 struct perf_session *session, u8 cpumode,
51 enum map_type type, pid_t pid, u64 addr,
52 struct addr_location *al,
53 symbol_filter_t filter);
54 #endif /* __PERF_THREAD_H */
55