perf tools: Add some comments to the event definitions
[safe/jmp/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 <linux/list.h>
7 #include <linux/rbtree.h>
8 #include "module.h"
9 #include "event.h"
10
11 struct symbol {
12         struct rb_node  rb_node;
13         u64             start;
14         u64             end;
15         u64             obj_start;
16         u64             hist_sum;
17         u64             *hist;
18         struct module   *module;
19         void            *priv;
20         char            name[0];
21 };
22
23 struct dso {
24         struct list_head node;
25         struct rb_root   syms;
26         struct symbol    *(*find_symbol)(struct dso *, u64 ip);
27         unsigned int     sym_priv_size;
28         unsigned char    adjust_symbols;
29         unsigned char    slen_calculated;
30         unsigned char    origin;
31         char             name[0];
32 };
33
34 const char *sym_hist_filter;
35
36 typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
37
38 struct dso *dso__new(const char *name, unsigned int sym_priv_size);
39 void dso__delete(struct dso *self);
40
41 static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
42 {
43         return ((void *)sym) - self->sym_priv_size;
44 }
45
46 struct symbol *dso__find_symbol(struct dso *self, u64 ip);
47
48 int dso__load_kernel(struct dso *self, const char *vmlinux,
49                      symbol_filter_t filter, int verbose, int modules);
50 int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
51 int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
52 struct dso *dsos__findnew(const char *name);
53 void dsos__fprintf(FILE *fp);
54
55 size_t dso__fprintf(struct dso *self, FILE *fp);
56 char dso__symtab_origin(const struct dso *self);
57
58 int load_kernel(void);
59
60 void symbol__init(void);
61
62 extern struct list_head dsos;
63 extern struct dso *kernel_dso;
64 extern struct dso *vdso;
65 extern struct dso *hypervisor_dso;
66 extern char *vmlinux;
67 extern int   modules;
68 #endif /* _PERF_SYMBOL_ */