]>
Commit | Line | Data |
---|---|---|
a2928c42 ACM |
1 | #ifndef _PERF_SYMBOL_ |
2 | #define _PERF_SYMBOL_ 1 | |
3 | ||
4 | #include <linux/types.h> | |
7c6a1c65 | 5 | #include "types.h" |
a2928c42 | 6 | #include "list.h" |
43cbcd8a | 7 | #include <linux/rbtree.h> |
a2928c42 ACM |
8 | |
9 | struct symbol { | |
10 | struct rb_node rb_node; | |
9cffa8d5 PM |
11 | u64 start; |
12 | u64 end; | |
13 | u64 obj_start; | |
14 | u64 hist_sum; | |
15 | u64 *hist; | |
301406b9 | 16 | void *priv; |
a2928c42 ACM |
17 | char name[0]; |
18 | }; | |
19 | ||
20 | struct dso { | |
21 | struct list_head node; | |
22 | struct rb_root syms; | |
9cffa8d5 | 23 | struct symbol *(*find_symbol)(struct dso *, u64 ip); |
f5812a7a ACM |
24 | unsigned int sym_priv_size; |
25 | unsigned char prelinked; | |
a2928c42 ACM |
26 | char name[0]; |
27 | }; | |
28 | ||
0b73da3f IM |
29 | const char *sym_hist_filter; |
30 | ||
69ee69f6 ACM |
31 | typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym); |
32 | ||
0085c954 | 33 | struct dso *dso__new(const char *name, unsigned int sym_priv_size); |
a2928c42 ACM |
34 | void dso__delete(struct dso *self); |
35 | ||
0085c954 ACM |
36 | static inline void *dso__sym_priv(struct dso *self, struct symbol *sym) |
37 | { | |
38 | return ((void *)sym) - self->sym_priv_size; | |
39 | } | |
40 | ||
9cffa8d5 | 41 | struct symbol *dso__find_symbol(struct dso *self, u64 ip); |
a2928c42 | 42 | |
69ee69f6 | 43 | int dso__load_kernel(struct dso *self, const char *vmlinux, |
bd74137e IM |
44 | symbol_filter_t filter, int verbose); |
45 | int dso__load(struct dso *self, symbol_filter_t filter, int verbose); | |
a2928c42 ACM |
46 | |
47 | size_t dso__fprintf(struct dso *self, FILE *fp); | |
48 | ||
49 | void symbol__init(void); | |
50 | #endif /* _PERF_SYMBOL_ */ |