1 #ifndef __PERF_THREAD_H
2 #define __PERF_THREAD_H
4 #include <linux/rbtree.h>
9 struct rb_root maps[MAP__NR_TYPES];
10 struct list_head removed_maps[MAP__NR_TYPES];
15 struct rb_node rb_node;
23 void map_groups__init(struct map_groups *self);
24 int thread__set_comm(struct thread *self, const char *comm);
25 int thread__comm_len(struct thread *self);
26 struct thread *threads__findnew(pid_t pid);
27 void thread__insert_map(struct thread *self, struct map *map);
28 int thread__fork(struct thread *self, struct thread *parent);
29 size_t map_groups__fprintf_maps(struct map_groups *self, FILE *fp);
30 size_t threads__fprintf(FILE *fp);
32 void maps__insert(struct rb_root *maps, struct map *map);
33 struct map *maps__find(struct rb_root *maps, u64 addr);
35 static inline void map_groups__insert(struct map_groups *self, struct map *map)
37 maps__insert(&self->maps[map->type], map);
40 static inline struct map *map_groups__find(struct map_groups *self,
41 enum map_type type, u64 addr)
43 return maps__find(&self->maps[type], addr);
46 static inline struct map *thread__find_map(struct thread *self,
47 enum map_type type, u64 addr)
49 return self ? map_groups__find(&self->mg, type, addr) : NULL;
52 void thread__find_addr_location(struct thread *self, u8 cpumode,
53 enum map_type type, u64 addr,
54 struct addr_location *al,
55 symbol_filter_t filter);
56 struct symbol *map_groups__find_symbol(struct map_groups *self,
57 enum map_type type, u64 addr,
58 symbol_filter_t filter);
60 static inline struct symbol *
61 map_groups__find_function(struct map_groups *self, u64 addr,
62 symbol_filter_t filter)
64 return map_groups__find_symbol(self, MAP__FUNCTION, addr, filter);
67 struct map *map_groups__find_by_name(struct map_groups *self,
68 enum map_type type, const char *name);
69 #endif /* __PERF_THREAD_H */