aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-25 18:58:58 -0400
committerIngo Molnar <mingo@elte.hu>2010-03-26 03:52:58 -0400
commit4b8cf84624e9a58a21aaac3d064222092ae234e0 (patch)
treeb3730987728f9280612fedbf24db50142e8ed253 /tools/perf/util/thread.h
parentb177f63f5226e75280855bbcd106e677250778bd (diff)
perf symbols: Move map related routines to map.c
Thru series of refactorings functions were being renamed but not moved to map.c to reduce patch noise, now lets have them in the same place so that use of the symbol system by tools can be constrained to building and linking fewer source files: symbol.c, map.c and rbtree.c. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1269557941-15617-3-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r--tools/perf/util/thread.h48
1 files changed, 2 insertions, 46 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index a81426a891bf..9c488fcadec9 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -5,14 +5,6 @@
5#include <unistd.h> 5#include <unistd.h>
6#include "symbol.h" 6#include "symbol.h"
7 7
8struct map_groups {
9 struct rb_root maps[MAP__NR_TYPES];
10 struct list_head removed_maps[MAP__NR_TYPES];
11};
12
13size_t __map_groups__fprintf_maps(struct map_groups *self,
14 enum map_type type, FILE *fp);
15
16struct thread { 8struct thread {
17 struct rb_node rb_node; 9 struct rb_node rb_node;
18 struct map_groups mg; 10 struct map_groups mg;
@@ -23,30 +15,16 @@ struct thread {
23 int comm_len; 15 int comm_len;
24}; 16};
25 17
18struct perf_session;
19
26int find_all_tid(int pid, pid_t ** all_tid); 20int find_all_tid(int pid, pid_t ** all_tid);
27void map_groups__init(struct map_groups *self);
28int thread__set_comm(struct thread *self, const char *comm); 21int thread__set_comm(struct thread *self, const char *comm);
29int thread__comm_len(struct thread *self); 22int thread__comm_len(struct thread *self);
30struct thread *perf_session__findnew(struct perf_session *self, pid_t pid); 23struct thread *perf_session__findnew(struct perf_session *self, pid_t pid);
31void thread__insert_map(struct thread *self, struct map *map); 24void thread__insert_map(struct thread *self, struct map *map);
32int thread__fork(struct thread *self, struct thread *parent); 25int thread__fork(struct thread *self, struct thread *parent);
33size_t map_groups__fprintf_maps(struct map_groups *self, FILE *fp);
34size_t perf_session__fprintf(struct perf_session *self, FILE *fp); 26size_t perf_session__fprintf(struct perf_session *self, FILE *fp);
35 27
36void maps__insert(struct rb_root *maps, struct map *map);
37struct map *maps__find(struct rb_root *maps, u64 addr);
38
39static inline void map_groups__insert(struct map_groups *self, struct map *map)
40{
41 maps__insert(&self->maps[map->type], map);
42}
43
44static inline struct map *map_groups__find(struct map_groups *self,
45 enum map_type type, u64 addr)
46{
47 return maps__find(&self->maps[type], addr);
48}
49
50static inline struct map *thread__find_map(struct thread *self, 28static inline struct map *thread__find_map(struct thread *self,
51 enum map_type type, u64 addr) 29 enum map_type type, u64 addr)
52{ 30{
@@ -63,26 +41,4 @@ void thread__find_addr_location(struct thread *self,
63 enum map_type type, u64 addr, 41 enum map_type type, u64 addr,
64 struct addr_location *al, 42 struct addr_location *al,
65 symbol_filter_t filter); 43 symbol_filter_t filter);
66struct symbol *map_groups__find_symbol(struct map_groups *self,
67 enum map_type type, u64 addr,
68 symbol_filter_t filter);
69
70static inline struct symbol *map_groups__find_function(struct map_groups *self,
71 u64 addr,
72 symbol_filter_t filter)
73{
74 return map_groups__find_symbol(self, MAP__FUNCTION, addr, filter);
75}
76
77struct map *map_groups__find_by_name(struct map_groups *self,
78 enum map_type type, const char *name);
79
80int __map_groups__create_kernel_maps(struct map_groups *self,
81 struct map *vmlinux_maps[MAP__NR_TYPES],
82 struct dso *kernel);
83int map_groups__create_kernel_maps(struct map_groups *self,
84 struct map *vmlinux_maps[MAP__NR_TYPES]);
85
86struct map *map_groups__new_module(struct map_groups *self, u64 start,
87 const char *filename);
88#endif /* __PERF_THREAD_H */ 44#endif /* __PERF_THREAD_H */