2 #define __PERF_SYMBOL 1
4 #include <linux/types.h>
8 #include <linux/list.h>
9 #include <linux/rbtree.h>
12 #define DEBUG_CACHE_DIR ".debug"
14 #ifdef HAVE_CPLUS_DEMANGLE
15 extern char *cplus_demangle(const char *, int);
17 static inline char *bfd_demangle(void __used
*v
, const char *c
, int i
)
19 return cplus_demangle(c
, i
);
23 static inline char *bfd_demangle(void __used
*v
, const char __used
*c
,
33 int hex2u64(const char *ptr
, u64
*val
);
34 char *strxfrchar(char *s
, char from
, char to
);
37 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
38 * for newer versions we can use mmap to reduce memory usage:
41 # define PERF_ELF_C_READ_MMAP ELF_C_READ
43 # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
47 #define DMGL_PARAMS (1 << 0) /* Include function args */
48 #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
51 #define BUILD_ID_SIZE 20
54 struct rb_node rb_node
;
60 void symbol__delete(struct symbol
*self
);
65 unsigned short priv_size
;
66 bool try_vmlinux_path
,
73 const char *vmlinux_name
,
79 struct strlist
*dso_list
,
84 extern struct symbol_conf symbol_conf
;
86 static inline void *symbol__priv(struct symbol
*self
)
88 return ((void *)self
) - symbol_conf
.priv_size
;
91 struct ref_reloc_sym
{
102 struct addr_location
{
103 struct thread
*thread
;
112 struct list_head node
;
113 struct rb_root symbols
[MAP__NR_TYPES
];
114 struct rb_root symbol_names
[MAP__NR_TYPES
];
116 u8 slen_calculated
:1;
120 u8 annotate_warned
:1;
121 unsigned char origin
;
124 u8 build_id
[BUILD_ID_SIZE
];
125 const char *short_name
;
132 struct dso
*dso__new(const char *name
);
133 struct dso
*dso__new_kernel(const char *name
);
134 void dso__delete(struct dso
*self
);
136 bool dso__loaded(const struct dso
*self
, enum map_type type
);
137 bool dso__sorted_by_name(const struct dso
*self
, enum map_type type
);
139 static inline void dso__set_loaded(struct dso
*self
, enum map_type type
)
141 self
->loaded
|= (1 << type
);
144 void dso__sort_by_name(struct dso
*self
, enum map_type type
);
146 extern struct list_head dsos__user
, dsos__kernel
;
148 struct dso
*__dsos__findnew(struct list_head
*head
, const char *name
);
150 static inline struct dso
*dsos__findnew(const char *name
)
152 return __dsos__findnew(&dsos__user
, name
);
155 int dso__load(struct dso
*self
, struct map
*map
, symbol_filter_t filter
);
156 int dso__load_vmlinux_path(struct dso
*self
, struct map
*map
,
157 symbol_filter_t filter
);
158 int dso__load_kallsyms(struct dso
*self
, const char *filename
, struct map
*map
,
159 symbol_filter_t filter
);
160 void dsos__fprintf(FILE *fp
);
161 size_t dsos__fprintf_buildid(FILE *fp
, bool with_hits
);
163 size_t dso__fprintf_buildid(struct dso
*self
, FILE *fp
);
164 size_t dso__fprintf(struct dso
*self
, enum map_type type
, FILE *fp
);
167 DSO__ORIG_KERNEL
= 0,
169 DSO__ORIG_BUILD_ID_CACHE
,
178 char dso__symtab_origin(const struct dso
*self
);
179 void dso__set_long_name(struct dso
*self
, char *name
);
180 void dso__set_build_id(struct dso
*self
, void *build_id
);
181 void dso__read_running_kernel_build_id(struct dso
*self
);
182 struct symbol
*dso__find_symbol(struct dso
*self
, enum map_type type
, u64 addr
);
183 struct symbol
*dso__find_symbol_by_name(struct dso
*self
, enum map_type type
,
186 int filename__read_build_id(const char *filename
, void *bf
, size_t size
);
187 int sysfs__read_build_id(const char *filename
, void *bf
, size_t size
);
188 bool dsos__read_build_ids(bool with_hits
);
189 int build_id__sprintf(const u8
*self
, int len
, char *bf
);
190 int kallsyms__parse(const char *filename
, void *arg
,
191 int (*process_symbol
)(void *arg
, const char *name
,
192 char type
, u64 start
));
194 int symbol__init(void);
195 bool symbol_type__is_a(char symbol_type
, enum map_type map_type
);
197 size_t vmlinux_path__fprintf(FILE *fp
);
199 #endif /* __PERF_SYMBOL */
This page took 0.035624 seconds and 6 git commands to generate.