perf report: Fix cut'n'paste error recently introduced
[deliverable/linux.git] / tools / perf / util / thread.h
CommitLineData
8b40f521
JK
1#ifndef __PERF_THREAD_H
2#define __PERF_THREAD_H
3
6baa0a5a 4#include <linux/rbtree.h>
6baa0a5a
FW
5#include <unistd.h>
6#include "symbol.h"
7
9958e1f0 8struct map_groups {
95011c60
ACM
9 struct rb_root maps[MAP__NR_TYPES];
10 struct list_head removed_maps[MAP__NR_TYPES];
9958e1f0
ACM
11};
12
13struct thread {
14 struct rb_node rb_node;
15 struct map_groups mg;
16 pid_t pid;
0ec04e16 17 char shortname[3];
b5fae128 18 char *comm;
a4fb581b 19 int comm_len;
6baa0a5a
FW
20};
21
9958e1f0 22void map_groups__init(struct map_groups *self);
6baa0a5a 23int thread__set_comm(struct thread *self, const char *comm);
a4fb581b 24int thread__comm_len(struct thread *self);
b3165f41 25struct thread *perf_session__findnew(struct perf_session *self, pid_t pid);
6baa0a5a
FW
26void thread__insert_map(struct thread *self, struct map *map);
27int thread__fork(struct thread *self, struct thread *parent);
9958e1f0 28size_t map_groups__fprintf_maps(struct map_groups *self, FILE *fp);
b3165f41 29size_t perf_session__fprintf(struct perf_session *self, FILE *fp);
8b40f521 30
1b46cddf 31void maps__insert(struct rb_root *maps, struct map *map);
1ed091c4 32struct map *maps__find(struct rb_root *maps, u64 addr);
439d473b 33
9958e1f0
ACM
34static inline void map_groups__insert(struct map_groups *self, struct map *map)
35{
36 maps__insert(&self->maps[map->type], map);
37}
38
39static inline struct map *map_groups__find(struct map_groups *self,
1ed091c4 40 enum map_type type, u64 addr)
1b46cddf 41{
9958e1f0 42 return maps__find(&self->maps[type], addr);
1b46cddf
ACM
43}
44
9958e1f0
ACM
45static inline struct map *thread__find_map(struct thread *self,
46 enum map_type type, u64 addr)
95011c60 47{
9958e1f0 48 return self ? map_groups__find(&self->mg, type, addr) : NULL;
95011c60 49}
1ed091c4 50
4aa65636
ACM
51void thread__find_addr_location(struct thread *self,
52 struct perf_session *session, u8 cpumode,
1ed091c4
ACM
53 enum map_type type, u64 addr,
54 struct addr_location *al,
55 symbol_filter_t filter);
9958e1f0 56struct symbol *map_groups__find_symbol(struct map_groups *self,
4aa65636 57 struct perf_session *session,
9958e1f0
ACM
58 enum map_type type, u64 addr,
59 symbol_filter_t filter);
1ed091c4
ACM
60
61static inline struct symbol *
4aa65636
ACM
62map_groups__find_function(struct map_groups *self, struct perf_session *session,
63 u64 addr, symbol_filter_t filter)
1ed091c4 64{
4aa65636 65 return map_groups__find_symbol(self, session, MAP__FUNCTION, addr, filter);
1ed091c4 66}
79406cd7
ACM
67
68struct map *map_groups__find_by_name(struct map_groups *self,
69 enum map_type type, const char *name);
8b40f521 70#endif /* __PERF_THREAD_H */
This page took 0.0476 seconds and 5 git commands to generate.