2 #define _PERF_SYMBOL_ 1
4 #include <linux/types.h>
6 #include <linux/list.h>
7 #include <linux/rbtree.h>
11 #ifdef HAVE_CPLUS_DEMANGLE
12 extern char *cplus_demangle(const char *, int);
14 static inline char *bfd_demangle(void __used *v, const char *c, int i)
16 return cplus_demangle(c, i);
20 static inline char *bfd_demangle(void __used *v, const char __used *c,
31 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
32 * for newer versions we can use mmap to reduce memory usage:
35 # define PERF_ELF_C_READ_MMAP ELF_C_READ
37 # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
41 #define DMGL_PARAMS (1 << 0) /* Include function args */
42 #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
46 struct rb_node rb_node;
52 struct module *module;
58 struct list_head node;
60 struct symbol *(*find_symbol)(struct dso *, u64 ip);
61 unsigned int sym_priv_size;
62 unsigned char adjust_symbols;
63 unsigned char slen_calculated;
68 extern const char *sym_hist_filter;
70 typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
72 struct dso *dso__new(const char *name, unsigned int sym_priv_size);
73 void dso__delete(struct dso *self);
75 static inline void *dso__sym_priv(struct dso *self, struct symbol *sym)
77 return ((void *)sym) - self->sym_priv_size;
80 struct symbol *dso__find_symbol(struct dso *self, u64 ip);
82 int dso__load_kernel(struct dso *self, const char *vmlinux,
83 symbol_filter_t filter, int verbose, int modules);
84 int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
85 int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
86 struct dso *dsos__findnew(const char *name);
87 void dsos__fprintf(FILE *fp);
89 size_t dso__fprintf(struct dso *self, FILE *fp);
90 char dso__symtab_origin(const struct dso *self);
92 int load_kernel(void);
94 void symbol__init(void);
96 extern struct list_head dsos;
97 extern struct dso *kernel_dso;
98 extern struct dso *vdso;
99 extern struct dso *hypervisor_dso;
100 extern const char *vmlinux_name;
102 #endif /* _PERF_SYMBOL_ */