diff options
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index eeb7ac62b9e3..4ebbb40d46d4 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -12,10 +12,12 @@ struct thread { | |||
12 | struct list_head node; | 12 | struct list_head node; |
13 | }; | 13 | }; |
14 | struct map_groups mg; | 14 | struct map_groups mg; |
15 | pid_t pid; | 15 | pid_t pid_; /* Not all tools update this */ |
16 | pid_t tid; | ||
16 | pid_t ppid; | 17 | pid_t ppid; |
17 | char shortname[3]; | 18 | char shortname[3]; |
18 | bool comm_set; | 19 | bool comm_set; |
20 | bool dead; /* if set thread has exited */ | ||
19 | char *comm; | 21 | char *comm; |
20 | int comm_len; | 22 | int comm_len; |
21 | 23 | ||
@@ -24,8 +26,12 @@ struct thread { | |||
24 | 26 | ||
25 | struct machine; | 27 | struct machine; |
26 | 28 | ||
27 | struct thread *thread__new(pid_t pid); | 29 | struct thread *thread__new(pid_t pid, pid_t tid); |
28 | void thread__delete(struct thread *self); | 30 | void thread__delete(struct thread *self); |
31 | static inline void thread__exited(struct thread *thread) | ||
32 | { | ||
33 | thread->dead = true; | ||
34 | } | ||
29 | 35 | ||
30 | int thread__set_comm(struct thread *self, const char *comm); | 36 | int thread__set_comm(struct thread *self, const char *comm); |
31 | int thread__comm_len(struct thread *self); | 37 | int thread__comm_len(struct thread *self); |
@@ -45,6 +51,15 @@ void thread__find_addr_map(struct thread *thread, struct machine *machine, | |||
45 | 51 | ||
46 | void thread__find_addr_location(struct thread *thread, struct machine *machine, | 52 | void thread__find_addr_location(struct thread *thread, struct machine *machine, |
47 | u8 cpumode, enum map_type type, u64 addr, | 53 | u8 cpumode, enum map_type type, u64 addr, |
48 | struct addr_location *al, | 54 | struct addr_location *al); |
49 | symbol_filter_t filter); | 55 | |
56 | static inline void *thread__priv(struct thread *thread) | ||
57 | { | ||
58 | return thread->priv; | ||
59 | } | ||
60 | |||
61 | static inline void thread__set_priv(struct thread *thread, void *p) | ||
62 | { | ||
63 | thread->priv = p; | ||
64 | } | ||
50 | #endif /* __PERF_THREAD_H */ | 65 | #endif /* __PERF_THREAD_H */ |