diff options
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 4ebbb40d46d4..897c1b2a750a 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -2,6 +2,7 @@ | |||
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> | ||
5 | #include <unistd.h> | 6 | #include <unistd.h> |
6 | #include <sys/types.h> | 7 | #include <sys/types.h> |
7 | #include "symbol.h" | 8 | #include "symbol.h" |
@@ -18,31 +19,34 @@ struct thread { | |||
18 | char shortname[3]; | 19 | char shortname[3]; |
19 | bool comm_set; | 20 | bool comm_set; |
20 | bool dead; /* if set thread has exited */ | 21 | bool dead; /* if set thread has exited */ |
21 | char *comm; | 22 | struct list_head comm_list; |
22 | int comm_len; | 23 | int comm_len; |
23 | 24 | ||
24 | void *priv; | 25 | void *priv; |
25 | }; | 26 | }; |
26 | 27 | ||
27 | struct machine; | 28 | struct machine; |
29 | struct comm; | ||
28 | 30 | ||
29 | struct thread *thread__new(pid_t pid, pid_t tid); | 31 | struct thread *thread__new(pid_t pid, pid_t tid); |
30 | void thread__delete(struct thread *self); | 32 | void thread__delete(struct thread *thread); |
31 | static inline void thread__exited(struct thread *thread) | 33 | static inline void thread__exited(struct thread *thread) |
32 | { | 34 | { |
33 | thread->dead = true; | 35 | thread->dead = true; |
34 | } | 36 | } |
35 | 37 | ||
36 | int thread__set_comm(struct thread *self, const char *comm); | 38 | int thread__set_comm(struct thread *thread, const char *comm, u64 timestamp); |
37 | int thread__comm_len(struct thread *self); | 39 | int thread__comm_len(struct thread *thread); |
38 | void thread__insert_map(struct thread *self, struct map *map); | 40 | struct comm *thread__comm(const struct thread *thread); |
39 | int thread__fork(struct thread *self, struct thread *parent); | 41 | const char *thread__comm_str(const struct thread *thread); |
42 | void thread__insert_map(struct thread *thread, struct map *map); | ||
43 | int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp); | ||
40 | size_t thread__fprintf(struct thread *thread, FILE *fp); | 44 | size_t thread__fprintf(struct thread *thread, FILE *fp); |
41 | 45 | ||
42 | static inline struct map *thread__find_map(struct thread *self, | 46 | static inline struct map *thread__find_map(struct thread *thread, |
43 | enum map_type type, u64 addr) | 47 | enum map_type type, u64 addr) |
44 | { | 48 | { |
45 | return self ? map_groups__find(&self->mg, type, addr) : NULL; | 49 | return thread ? map_groups__find(&thread->mg, type, addr) : NULL; |
46 | } | 50 | } |
47 | 51 | ||
48 | void thread__find_addr_map(struct thread *thread, struct machine *machine, | 52 | void thread__find_addr_map(struct thread *thread, struct machine *machine, |