aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r--tools/perf/util/thread.h12
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
9struct thread { 8struct 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 *
21register_idle_thread(struct rb_root *threads, struct thread **last_match); 20register_idle_thread(struct rb_root *threads, struct thread **last_match);
22void thread__insert_map(struct thread *self, struct map *map); 21void thread__insert_map(struct thread *self, struct map *map);
23int thread__fork(struct thread *self, struct thread *parent); 22int thread__fork(struct thread *self, struct thread *parent);
24struct map *thread__find_map(struct thread *self, u64 ip);
25size_t threads__fprintf(FILE *fp, struct rb_root *threads); 23size_t threads__fprintf(FILE *fp, struct rb_root *threads);
26 24
25void maps__insert(struct rb_root *maps, struct map *map);
26struct map *maps__find(struct rb_root *maps, u64 ip);
27
28static 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 */