]>
Commit | Line | Data |
---|---|---|
8b40f521 JK |
1 | #ifndef __PERF_THREAD_H |
2 | #define __PERF_THREAD_H | |
3 | ||
6baa0a5a | 4 | #include <linux/rbtree.h> |
6baa0a5a FW |
5 | #include <unistd.h> |
6 | #include "symbol.h" | |
7 | ||
9958e1f0 | 8 | struct thread { |
720a3aeb ACM |
9 | union { |
10 | struct rb_node rb_node; | |
11 | struct list_head node; | |
12 | }; | |
9958e1f0 ACM |
13 | struct map_groups mg; |
14 | pid_t pid; | |
0ec04e16 | 15 | char shortname[3]; |
faa5c5c3 | 16 | bool comm_set; |
b5fae128 | 17 | char *comm; |
a4fb581b | 18 | int comm_len; |
6baa0a5a FW |
19 | }; |
20 | ||
743eb868 | 21 | struct machine; |
4b8cf846 | 22 | |
591765fd ACM |
23 | void thread__delete(struct thread *self); |
24 | ||
6baa0a5a | 25 | int thread__set_comm(struct thread *self, const char *comm); |
a4fb581b | 26 | int thread__comm_len(struct thread *self); |
6baa0a5a FW |
27 | void thread__insert_map(struct thread *self, struct map *map); |
28 | int thread__fork(struct thread *self, struct thread *parent); | |
8b40f521 | 29 | |
9958e1f0 ACM |
30 | static inline struct map *thread__find_map(struct thread *self, |
31 | enum map_type type, u64 addr) | |
95011c60 | 32 | { |
9958e1f0 | 33 | return self ? map_groups__find(&self->mg, type, addr) : NULL; |
95011c60 | 34 | } |
1ed091c4 | 35 | |
743eb868 ACM |
36 | void thread__find_addr_map(struct thread *thread, struct machine *machine, |
37 | u8 cpumode, enum map_type type, u64 addr, | |
59ee68ec ACM |
38 | struct addr_location *al); |
39 | ||
743eb868 ACM |
40 | void thread__find_addr_location(struct thread *thread, struct machine *machine, |
41 | u8 cpumode, enum map_type type, u64 addr, | |
1ed091c4 ACM |
42 | struct addr_location *al, |
43 | symbol_filter_t filter); | |
8b40f521 | 44 | #endif /* __PERF_THREAD_H */ |