diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-14 06:21:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-15 10:10:19 -0400 |
commit | 6baa0a5ae0954fb2486c480a20556a9f1aee0965 (patch) | |
tree | b85e485562b34b222153d41414dec655724e26b8 /tools/perf/util/thread.h | |
parent | be750231ce1599b86fbba213e3da8344ece262e2 (diff) |
perf tools: Factorize the thread code in a dedicated file
Factorize the thread management code used by perf-annotate and
perf-report in dedicated source and header files.
v2: pass last_match by address so that it can actually be
modified.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1250245313-6995-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h new file mode 100644 index 000000000000..b1c66719379b --- /dev/null +++ b/tools/perf/util/thread.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #include <linux/rbtree.h> | ||
2 | #include <linux/list.h> | ||
3 | #include <unistd.h> | ||
4 | #include "symbol.h" | ||
5 | |||
6 | struct thread { | ||
7 | struct rb_node rb_node; | ||
8 | struct list_head maps; | ||
9 | pid_t pid; | ||
10 | char *comm; | ||
11 | }; | ||
12 | |||
13 | int thread__set_comm(struct thread *self, const char *comm); | ||
14 | struct thread * | ||
15 | threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match); | ||
16 | void thread__insert_map(struct thread *self, struct map *map); | ||
17 | int thread__fork(struct thread *self, struct thread *parent); | ||
18 | struct map *thread__find_map(struct thread *self, u64 ip); | ||
19 | size_t threads__fprintf(FILE *fp, struct rb_root *threads); | ||