Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
[linux-2.6] / tools / perf / util / symbol.h
1 #ifndef _PERF_SYMBOL_
2 #define _PERF_SYMBOL_ 1
3
4 #include <linux/types.h>
5 #include "types.h"
6 #include "list.h"
7 #include "rbtree.h"
8
9 struct symbol {
10         struct rb_node  rb_node;
11         u64             start;
12         u64             end;
13         u64             obj_start;
14         u64             hist_sum;
15         u64             *hist;
16         void            *priv;
17         char            name[0];
18 };
19
20 struct dso {
21         struct list_head node;
22         struct rb_root   syms;
23         struct symbol    *(*find_symbol)(struct dso *, u64 ip);
24         unsigned int     sym_priv_size;
25         unsigned char    prelinked;
26         char             name[0];
27 };
28
29 const char *sym_hist_filter;
30
31 typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
32
33 struct dso *dso__new(const char *name, unsigned int sym_priv_size);
34 void dso__delete(struct dso *self);
35
36 static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
37 {
38         return ((void *)sym) - self->sym_priv_size;
39 }
40
41 struct symbol *dso__find_symbol(struct dso *self, u64 ip);
42
43 int dso__load_kernel(struct dso *self, const char *vmlinux,
44                      symbol_filter_t filter, int verbose);
45 int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
46
47 size_t dso__fprintf(struct dso *self, FILE *fp);
48
49 void symbol__init(void);
50 #endif /* _PERF_SYMBOL_ */