diff options
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 693ed1ea10b4..bbb37c1a52ee 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -2,13 +2,12 @@ | |||
2 | #define __PERF_THREAD_H | 2 | #define __PERF_THREAD_H |
3 | 3 | ||
4 | #include <linux/rbtree.h> | 4 | #include <linux/rbtree.h> |
5 | #include <linux/list.h> | ||
6 | #include <unistd.h> | 5 | #include <unistd.h> |
7 | #include "symbol.h" | 6 | #include "symbol.h" |
8 | 7 | ||
9 | struct thread { | 8 | struct thread { |
10 | struct rb_node rb_node; | 9 | struct rb_node rb_node; |
11 | struct list_head maps; | 10 | struct rb_root maps; |
12 | pid_t pid; | 11 | pid_t pid; |
13 | char shortname[3]; | 12 | char shortname[3]; |
14 | char *comm; | 13 | char *comm; |
@@ -21,7 +20,14 @@ struct thread * | |||
21 | register_idle_thread(struct rb_root *threads, struct thread **last_match); | 20 | register_idle_thread(struct rb_root *threads, struct thread **last_match); |
22 | void thread__insert_map(struct thread *self, struct map *map); | 21 | void thread__insert_map(struct thread *self, struct map *map); |
23 | int thread__fork(struct thread *self, struct thread *parent); | 22 | int thread__fork(struct thread *self, struct thread *parent); |
24 | struct map *thread__find_map(struct thread *self, u64 ip); | ||
25 | size_t threads__fprintf(FILE *fp, struct rb_root *threads); | 23 | size_t threads__fprintf(FILE *fp, struct rb_root *threads); |
26 | 24 | ||
25 | void maps__insert(struct rb_root *maps, struct map *map); | ||
26 | struct map *maps__find(struct rb_root *maps, u64 ip); | ||
27 | |||
28 | static inline struct map *thread__find_map(struct thread *self, u64 ip) | ||
29 | { | ||
30 | return self ? maps__find(&self->maps, ip) : NULL; | ||
31 | } | ||
32 | |||
27 | #endif /* __PERF_THREAD_H */ | 33 | #endif /* __PERF_THREAD_H */ |