]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - tools/perf/util/thread.h
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
];
13 size_t __map_groups__fprintf_maps(struct map_groups
*self
,
14 enum map_type type
, FILE *fp
);
17 struct rb_node rb_node
;
26 void map_groups__init(struct map_groups
*self
);
27 int thread__set_comm(struct thread
*self
, const char *comm
);
28 int thread__comm_len(struct thread
*self
);
29 struct thread
*perf_session__findnew(struct perf_session
*self
, pid_t pid
);
30 void thread__insert_map(struct thread
*self
, struct map
*map
);
31 int thread__fork(struct thread
*self
, struct thread
*parent
);
32 size_t map_groups__fprintf_maps(struct map_groups
*self
, FILE *fp
);
33 size_t perf_session__fprintf(struct perf_session
*self
, FILE *fp
);
35 void maps__insert(struct rb_root
*maps
, struct map
*map
);
36 struct map
*maps__find(struct rb_root
*maps
, u64 addr
);
38 static inline void map_groups__insert(struct map_groups
*self
, struct map
*map
)
40 maps__insert(&self
->maps
[map
->type
], map
);
43 static inline struct map
*map_groups__find(struct map_groups
*self
,
44 enum map_type type
, u64 addr
)
46 return maps__find(&self
->maps
[type
], addr
);
49 static inline struct map
*thread__find_map(struct thread
*self
,
50 enum map_type type
, u64 addr
)
52 return self
? map_groups__find(&self
->mg
, type
, addr
) : NULL
;
55 void thread__find_addr_map(struct thread
*self
,
56 struct perf_session
*session
, u8 cpumode
,
57 enum map_type type
, u64 addr
,
58 struct addr_location
*al
);
60 void thread__find_addr_location(struct thread
*self
,
61 struct perf_session
*session
, u8 cpumode
,
62 enum map_type type
, u64 addr
,
63 struct addr_location
*al
,
64 symbol_filter_t filter
);
65 struct symbol
*map_groups__find_symbol(struct map_groups
*self
,
66 enum map_type type
, u64 addr
,
67 symbol_filter_t filter
);
69 static inline struct symbol
*map_groups__find_function(struct map_groups
*self
,
71 symbol_filter_t filter
)
73 return map_groups__find_symbol(self
, MAP__FUNCTION
, addr
, filter
);
76 struct map
*map_groups__find_by_name(struct map_groups
*self
,
77 enum map_type type
, const char *name
);
79 int __map_groups__create_kernel_maps(struct map_groups
*self
,
80 struct map
*vmlinux_maps
[MAP__NR_TYPES
],
82 int map_groups__create_kernel_maps(struct map_groups
*self
,
83 struct map
*vmlinux_maps
[MAP__NR_TYPES
]);
85 struct map
*map_groups__new_module(struct map_groups
*self
, u64 start
,
86 const char *filename
);
87 #endif /* __PERF_THREAD_H */