blob: 4ff45e30c72674583db9f63fb4c8116153b9cba2 [file] [log] [blame]
John Kacur8b40f522009-09-24 18:02:18 +02001#ifndef __PERF_SYMBOL
2#define __PERF_SYMBOL 1
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -03003
4#include <linux/types.h>
Arnaldo Carvalho de Meloe4204992009-10-20 14:25:40 -02005#include <stdbool.h>
Arnaldo Carvalho de Melo5aab6212010-03-25 19:59:00 -03006#include <stdint.h>
7#include "map.h"
Roberto Agostino Vitillob5387522012-02-09 23:21:01 +01008#include "../perf.h"
Arnaldo Carvalho de Melo5da50252009-07-01 14:46:08 -03009#include <linux/list.h>
Arnaldo Carvalho de Melo43cbcd82009-07-01 12:28:37 -030010#include <linux/rbtree.h>
Arnaldo Carvalho de Melo5aab6212010-03-25 19:59:00 -030011#include <stdio.h>
Jiri Olsa8db48412012-05-30 14:23:42 +020012#include <byteswap.h>
Irina Tirdeab771a832012-09-08 03:43:17 +030013#include <libgen.h>
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -030014
Cody P Schaferb68e2f92012-08-10 15:22:57 -070015#ifndef NO_LIBELF_SUPPORT
16#include <libelf.h>
17#include <gelf.h>
18#include <elf.h>
19#endif
20
Arnaldo Carvalho de Melo247648e2009-08-11 16:22:11 -030021#ifdef HAVE_CPLUS_DEMANGLE
22extern char *cplus_demangle(const char *, int);
23
Irina Tirdea1d037ca2012-09-11 01:15:03 +030024static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
Arnaldo Carvalho de Melo247648e2009-08-11 16:22:11 -030025{
26 return cplus_demangle(c, i);
27}
28#else
29#ifdef NO_DEMANGLE
Irina Tirdea1d037ca2012-09-11 01:15:03 +030030static inline char *bfd_demangle(void __maybe_unused *v,
31 const char __maybe_unused *c,
32 int __maybe_unused i)
Arnaldo Carvalho de Melo247648e2009-08-11 16:22:11 -030033{
34 return NULL;
35}
36#else
37#include <bfd.h>
38#endif
39#endif
40
Arnaldo Carvalho de Melo5aab6212010-03-25 19:59:00 -030041int hex2u64(const char *ptr, u64 *val);
42char *strxfrchar(char *s, char from, char to);
43
Marti Raudsepp84087122009-10-24 19:10:36 +030044/*
45 * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
46 * for newer versions we can use mmap to reduce memory usage:
47 */
48#ifdef LIBELF_NO_MMAP
49# define PERF_ELF_C_READ_MMAP ELF_C_READ
50#else
51# define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP
52#endif
53
Arnaldo Carvalho de Melo247648e2009-08-11 16:22:11 -030054#ifndef DMGL_PARAMS
55#define DMGL_PARAMS (1 << 0) /* Include function args */
56#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
57#endif
58
Arnaldo Carvalho de Melo5aab6212010-03-25 19:59:00 -030059#define BUILD_ID_SIZE 20
60
Arnaldo Carvalho de Melo171b3be2011-03-11 13:36:01 -030061/** struct symbol - symtab entry
62 *
63 * @ignore - resolvable but tools ignore it (e.g. idle routines)
64 */
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -030065struct symbol {
66 struct rb_node rb_node;
Paul Mackerras9cffa8d2009-06-19 22:21:42 +100067 u64 start;
68 u64 end;
Arnaldo Carvalho de Melofefb0b92010-05-10 13:57:51 -030069 u16 namelen;
Arnaldo Carvalho de Meloc408fed2010-08-05 12:59:47 -030070 u8 binding;
Arnaldo Carvalho de Melo171b3be2011-03-11 13:36:01 -030071 bool ignore;
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -030072 char name[0];
73};
74
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -030075void symbol__delete(struct symbol *sym);
Arnaldo Carvalho de Melo628ada02010-02-25 12:57:40 -030076
Arnaldo Carvalho de Melo1b2e2df2012-04-19 10:57:06 -030077static inline size_t symbol__size(const struct symbol *sym)
78{
79 return sym->end - sym->start + 1;
80}
81
Arnaldo Carvalho de Melo655000e2009-12-15 20:04:40 -020082struct strlist;
83
Arnaldo Carvalho de Melob32d1332009-11-24 12:05:15 -020084struct symbol_conf {
85 unsigned short priv_size;
Arnaldo Carvalho de Melod04b35f2011-11-11 22:17:32 -020086 unsigned short nr_events;
Arnaldo Carvalho de Melob32d1332009-11-24 12:05:15 -020087 bool try_vmlinux_path,
Akihiro Nagai0bc8d202012-01-30 13:43:20 +090088 show_kernel_path,
Arnaldo Carvalho de Melo79406cd2009-12-11 18:50:22 -020089 use_modules,
Arnaldo Carvalho de Melod599db32009-12-15 20:04:42 -020090 sort_by_name,
91 show_nr_samples,
Arnaldo Carvalho de Melo3f2728b2011-10-05 16:10:06 -030092 show_total_period,
Arnaldo Carvalho de Melod599db32009-12-15 20:04:42 -020093 use_callchain,
Arnaldo Carvalho de Melof7d87442009-12-27 21:37:04 -020094 exclude_other,
Jovi Zhang85e00b52010-09-09 13:30:59 -030095 show_cpu_utilization,
Arnaldo Carvalho de Meloec80fde2011-05-26 09:53:51 -030096 initialized,
Stephane Eranian3e6a2a72011-05-17 17:32:07 +020097 kptr_restrict,
98 annotate_asm_raw,
99 annotate_src;
Arnaldo Carvalho de Meloc410a332009-12-15 20:04:41 -0200100 const char *vmlinux_name,
David Ahernb226a5a72010-12-07 19:39:46 -0700101 *kallsyms_name,
Chase Douglas9ed7e1b2010-06-14 15:26:30 -0400102 *source_prefix,
Arnaldo Carvalho de Meloc410a332009-12-15 20:04:41 -0200103 *field_sep;
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800104 const char *default_guest_vmlinux_name,
105 *default_guest_kallsyms,
106 *default_guest_modules;
107 const char *guestmount;
Arnaldo Carvalho de Meloedb7c602010-05-17 16:22:41 -0300108 const char *dso_list_str,
Arnaldo Carvalho de Melo655000e2009-12-15 20:04:40 -0200109 *comm_list_str,
110 *sym_list_str,
111 *col_width_list_str;
112 struct strlist *dso_list,
113 *comm_list,
Stephane Eraniana68c2c52012-03-08 23:47:48 +0100114 *sym_list,
115 *dso_from_list,
116 *dso_to_list,
117 *sym_from_list,
118 *sym_to_list;
David Ahernec5761e2010-12-09 13:27:07 -0700119 const char *symfs;
Arnaldo Carvalho de Melob32d1332009-11-24 12:05:15 -0200120};
121
Arnaldo Carvalho de Melo75be6cf2009-12-15 20:04:39 -0200122extern struct symbol_conf symbol_conf;
Arnaldo Carvalho de Melo00a192b2009-10-30 16:28:24 -0200123
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300124static inline void *symbol__priv(struct symbol *sym)
Arnaldo Carvalho de Melo00a192b2009-10-30 16:28:24 -0200125{
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300126 return ((void *)sym) - symbol_conf.priv_size;
Arnaldo Carvalho de Melo00a192b2009-10-30 16:28:24 -0200127}
128
Arnaldo Carvalho de Melo9de89fe2010-02-03 16:52:00 -0200129struct ref_reloc_sym {
130 const char *name;
131 u64 addr;
132 u64 unrelocated_addr;
133};
134
Arnaldo Carvalho de Melo59fd5302010-03-24 16:40:17 -0300135struct map_symbol {
136 struct map *map;
137 struct symbol *sym;
Arnaldo Carvalho de Melo0f0cbf72010-07-26 17:13:40 -0300138 bool unfolded;
139 bool has_children;
Arnaldo Carvalho de Melo59fd5302010-03-24 16:40:17 -0300140};
141
Roberto Agostino Vitillob5387522012-02-09 23:21:01 +0100142struct addr_map_symbol {
143 struct map *map;
144 struct symbol *sym;
145 u64 addr;
Stephane Eraniana68c2c52012-03-08 23:47:48 +0100146 u64 al_addr;
Roberto Agostino Vitillob5387522012-02-09 23:21:01 +0100147};
148
149struct branch_info {
150 struct addr_map_symbol from;
151 struct addr_map_symbol to;
152 struct branch_flags flags;
153};
154
Arnaldo Carvalho de Melo1ed091c2009-11-27 16:29:23 -0200155struct addr_location {
156 struct thread *thread;
157 struct map *map;
158 struct symbol *sym;
159 u64 addr;
160 char level;
Arnaldo Carvalho de Meloc410a332009-12-15 20:04:41 -0200161 bool filtered;
Arun Sharmaf60f3592010-06-04 11:27:10 -0300162 u8 cpumode;
163 s32 cpu;
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800164};
165
Jiri Olsa44f24cb2012-07-22 14:14:32 +0200166enum dso_binary_type {
167 DSO_BINARY_TYPE__KALLSYMS = 0,
168 DSO_BINARY_TYPE__GUEST_KALLSYMS,
Cody P Schafer21ea4532012-08-10 15:22:56 -0700169 DSO_BINARY_TYPE__VMLINUX,
170 DSO_BINARY_TYPE__GUEST_VMLINUX,
Jiri Olsa44f24cb2012-07-22 14:14:32 +0200171 DSO_BINARY_TYPE__JAVA_JIT,
172 DSO_BINARY_TYPE__DEBUGLINK,
173 DSO_BINARY_TYPE__BUILD_ID_CACHE,
174 DSO_BINARY_TYPE__FEDORA_DEBUGINFO,
175 DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
176 DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
177 DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
178 DSO_BINARY_TYPE__GUEST_KMODULE,
179 DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
180 DSO_BINARY_TYPE__NOT_FOUND,
181};
182
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800183enum dso_kernel_type {
184 DSO_TYPE_USER = 0,
185 DSO_TYPE_KERNEL,
186 DSO_TYPE_GUEST_KERNEL
Arnaldo Carvalho de Melo1ed091c2009-11-27 16:29:23 -0200187};
188
Jiri Olsa8db48412012-05-30 14:23:42 +0200189enum dso_swap_type {
190 DSO_SWAP__UNSET,
191 DSO_SWAP__NO,
192 DSO_SWAP__YES,
193};
194
Jiri Olsa4dff6242012-07-22 14:14:39 +0200195#define DSO__DATA_CACHE_SIZE 4096
196#define DSO__DATA_CACHE_MASK ~(DSO__DATA_CACHE_SIZE - 1)
197
198struct dso_cache {
199 struct rb_node rb_node;
200 u64 offset;
201 u64 size;
202 char data[0];
203};
204
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300205struct dso {
206 struct list_head node;
Arnaldo Carvalho de Melo6a4694a2009-11-27 16:29:17 -0200207 struct rb_root symbols[MAP__NR_TYPES];
Arnaldo Carvalho de Melo79406cd2009-12-11 18:50:22 -0200208 struct rb_root symbol_names[MAP__NR_TYPES];
Jiri Olsa4dff6242012-07-22 14:14:39 +0200209 struct rb_root cache;
Arnaldo Carvalho de Melo6e406252010-07-29 15:11:30 -0300210 enum dso_kernel_type kernel;
Jiri Olsa8db48412012-05-30 14:23:42 +0200211 enum dso_swap_type needs_swap;
Jiri Olsa44f24cb2012-07-22 14:14:32 +0200212 enum dso_binary_type symtab_type;
Jiri Olsa949d1602012-07-22 14:14:33 +0200213 enum dso_binary_type data_type;
Arnaldo Carvalho de Melo8d063672009-11-04 18:50:43 -0200214 u8 adjust_symbols:1;
Arnaldo Carvalho de Melo8d063672009-11-04 18:50:43 -0200215 u8 has_build_id:1;
Arnaldo Carvalho de Melo88d3d9b72010-01-14 23:45:30 -0200216 u8 hit:1;
Arnaldo Carvalho de Melod06d92b2010-03-15 13:04:33 -0300217 u8 annotate_warned:1;
Arnaldo Carvalho de Melo6e406252010-07-29 15:11:30 -0300218 u8 sname_alloc:1;
219 u8 lname_alloc:1;
Arnaldo Carvalho de Melo79406cd2009-12-11 18:50:22 -0200220 u8 sorted_by_name;
Arnaldo Carvalho de Melo36105832009-11-27 16:29:16 -0200221 u8 loaded;
Arnaldo Carvalho de Melo8d063672009-11-04 18:50:43 -0200222 u8 build_id[BUILD_ID_SIZE];
Arnaldo Carvalho de Melo439d4732009-10-02 03:29:58 -0300223 const char *short_name;
224 char *long_name;
Arnaldo Carvalho de Melob63be8d2010-03-15 15:03:50 -0300225 u16 long_name_len;
226 u16 short_name_len;
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300227 char name[0];
228};
229
Cody P Schaferb68e2f92012-08-10 15:22:57 -0700230struct symsrc {
231 char *name;
232 int fd;
233 enum dso_binary_type type;
234
235#ifndef NO_LIBELF_SUPPORT
236 Elf *elf;
237 GElf_Ehdr ehdr;
238
239 Elf_Scn *opdsec;
240 size_t opdidx;
241 GElf_Shdr opdshdr;
242
243 Elf_Scn *symtab;
244 GElf_Shdr symshdr;
245
246 Elf_Scn *dynsym;
247 size_t dynsym_idx;
248 GElf_Shdr dynshdr;
249
250 bool adjust_symbols;
251#endif
252};
253
254void symsrc__destroy(struct symsrc *ss);
255int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
256 enum dso_binary_type type);
Cody P Schaferd26cd122012-08-10 15:23:00 -0700257bool symsrc__has_symtab(struct symsrc *ss);
Cody P Schafer3aafe5a2012-08-10 15:23:02 -0700258bool symsrc__possibly_runtime(struct symsrc *ss);
Cody P Schaferb68e2f92012-08-10 15:22:57 -0700259
Jiri Olsa8db48412012-05-30 14:23:42 +0200260#define DSO__SWAP(dso, type, val) \
261({ \
262 type ____r = val; \
263 BUG_ON(dso->needs_swap == DSO_SWAP__UNSET); \
264 if (dso->needs_swap == DSO_SWAP__YES) { \
265 switch (sizeof(____r)) { \
266 case 2: \
267 ____r = bswap_16(val); \
268 break; \
269 case 4: \
270 ____r = bswap_32(val); \
271 break; \
272 case 8: \
273 ____r = bswap_64(val); \
274 break; \
275 default: \
276 BUG_ON(1); \
277 } \
278 } \
279 ____r; \
280})
281
Arnaldo Carvalho de Melo00a192b2009-10-30 16:28:24 -0200282struct dso *dso__new(const char *name);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300283void dso__delete(struct dso *dso);
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300284
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300285int dso__name_len(const struct dso *dso);
Arnaldo Carvalho de Melo8a6c5b22010-07-20 14:42:52 -0300286
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300287bool dso__loaded(const struct dso *dso, enum map_type type);
288bool dso__sorted_by_name(const struct dso *dso, enum map_type type);
Arnaldo Carvalho de Melo79406cd2009-12-11 18:50:22 -0200289
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300290static inline void dso__set_loaded(struct dso *dso, enum map_type type)
Arnaldo Carvalho de Melo8d92c022010-02-03 16:52:02 -0200291{
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300292 dso->loaded |= (1 << type);
Arnaldo Carvalho de Melo8d92c022010-02-03 16:52:02 -0200293}
294
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300295void dso__sort_by_name(struct dso *dso, enum map_type type);
Arnaldo Carvalho de Melo36105832009-11-27 16:29:16 -0200296
Namhyung Kime5a18452012-08-06 13:41:20 +0900297void dsos__add(struct list_head *head, struct dso *dso);
Jiri Olsa1c4be9f2012-09-10 18:50:18 +0200298struct dso *dsos__find(struct list_head *head, const char *name);
Arnaldo Carvalho de Meloa89e5abe2010-01-07 19:59:39 -0200299struct dso *__dsos__findnew(struct list_head *head, const char *name);
300
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300301int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter);
302int dso__load_vmlinux(struct dso *dso, struct map *map,
Franck Bui-Huufd930ff2010-12-10 14:06:03 +0100303 const char *vmlinux, symbol_filter_t filter);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300304int dso__load_vmlinux_path(struct dso *dso, struct map *map,
Arnaldo Carvalho de Melo9de89fe2010-02-03 16:52:00 -0200305 symbol_filter_t filter);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300306int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
Arnaldo Carvalho de Melo9de89fe2010-02-03 16:52:00 -0200307 symbol_filter_t filter);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300308int machine__load_kallsyms(struct machine *machine, const char *filename,
Arnaldo Carvalho de Melo5c0541d2010-04-29 15:25:23 -0300309 enum map_type type, symbol_filter_t filter);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300310int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
Arnaldo Carvalho de Melo5c0541d2010-04-29 15:25:23 -0300311 symbol_filter_t filter);
312
Arnaldo Carvalho de Melo1f626bc2010-05-09 19:57:08 -0300313size_t __dsos__fprintf(struct list_head *head, FILE *fp);
314
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300315size_t machine__fprintf_dsos_buildid(struct machine *machine,
316 FILE *fp, bool with_hits);
317size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp);
318size_t machines__fprintf_dsos_buildid(struct rb_root *machines,
319 FILE *fp, bool with_hits);
320size_t dso__fprintf_buildid(struct dso *dso, FILE *fp);
321size_t dso__fprintf_symbols_by_name(struct dso *dso,
322 enum map_type type, FILE *fp);
323size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp);
Arnaldo Carvalho de Melob0a9ab62010-03-15 11:46:58 -0300324
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300325char dso__symtab_origin(const struct dso *dso);
326void dso__set_long_name(struct dso *dso, char *name);
327void dso__set_build_id(struct dso *dso, void *build_id);
Namhyung Kime5a18452012-08-06 13:41:20 +0900328bool dso__build_id_equal(const struct dso *dso, u8 *build_id);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300329void dso__read_running_kernel_build_id(struct dso *dso,
330 struct machine *machine);
Srikar Dronamraju225466f2012-04-16 17:39:09 +0530331struct map *dso__new_map(const char *name);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300332struct symbol *dso__find_symbol(struct dso *dso, enum map_type type,
333 u64 addr);
334struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
Arnaldo Carvalho de Melo79406cd2009-12-11 18:50:22 -0200335 const char *name);
Arnaldo Carvalho de Meloa2928c42009-05-28 14:55:04 -0300336
Arnaldo Carvalho de Melo2643ce1142009-11-03 21:46:10 -0200337int filename__read_build_id(const char *filename, void *bf, size_t size);
Arnaldo Carvalho de Melof1617b42009-11-18 20:20:52 -0200338int sysfs__read_build_id(const char *filename, void *bf, size_t size);
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800339bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300340int build_id__sprintf(const u8 *build_id, int len, char *bf);
Arnaldo Carvalho de Melo9e201442010-01-14 18:30:06 -0200341int kallsyms__parse(const char *filename, void *arg,
342 int (*process_symbol)(void *arg, const char *name,
Cody P Schafer82151522012-08-10 15:22:48 -0700343 char type, u64 start));
Namhyung Kime5a18452012-08-06 13:41:20 +0900344int filename__read_debuglink(const char *filename, char *debuglink,
345 size_t size);
Arnaldo Carvalho de Melo2643ce1142009-11-03 21:46:10 -0200346
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300347void machine__destroy_kernel_maps(struct machine *machine);
348int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel);
349int machine__create_kernel_maps(struct machine *machine);
Arnaldo Carvalho de Melo5c0541d2010-04-29 15:25:23 -0300350
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300351int machines__create_kernel_maps(struct rb_root *machines, pid_t pid);
352int machines__create_guest_kernel_maps(struct rb_root *machines);
353void machines__destroy_guest_kernel_maps(struct rb_root *machines);
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800354
Arnaldo Carvalho de Melo75be6cf2009-12-15 20:04:39 -0200355int symbol__init(void);
Arnaldo Carvalho de Melod65a4582010-07-30 18:31:28 -0300356void symbol__exit(void);
Namhyung Kim166ccc92012-08-06 13:41:19 +0900357void symbol__elf_init(void);
Namhyung Kime5a18452012-08-06 13:41:20 +0900358struct symbol *symbol__new(u64 start, u64 len, u8 binding, const char *name);
Akihiro Nagaia978f2a2012-01-30 13:43:15 +0900359size_t symbol__fprintf_symname_offs(const struct symbol *sym,
360 const struct addr_location *al, FILE *fp);
Akihiro Nagai547a92e2012-01-30 13:42:57 +0900361size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);
Arnaldo Carvalho de Melo36a3e642010-01-04 16:19:27 -0200362bool symbol_type__is_a(char symbol_type, enum map_type map_type);
363
Arnaldo Carvalho de Meloaeafcba2011-03-31 10:56:28 -0300364size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
Arnaldo Carvalho de Melob0a9ab62010-03-15 11:46:58 -0300365
Jiri Olsa44f24cb2012-07-22 14:14:32 +0200366int dso__binary_type_file(struct dso *dso, enum dso_binary_type type,
367 char *root_dir, char *file, size_t size);
Jiri Olsa949d1602012-07-22 14:14:33 +0200368
369int dso__data_fd(struct dso *dso, struct machine *machine);
370ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
371 u64 offset, u8 *data, ssize_t size);
372ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
373 struct machine *machine, u64 addr,
374 u8 *data, ssize_t size);
Jiri Olsaf7add552012-07-22 14:14:40 +0200375int dso__test_data(void);
Cody P Schafer261360b2012-08-10 15:23:01 -0700376int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
377 struct symsrc *runtime_ss, symbol_filter_t filter,
378 int kmodule);
Cody P Schafera44f6052012-08-10 15:22:59 -0700379int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss,
380 struct map *map, symbol_filter_t filter);
Namhyung Kime5a18452012-08-06 13:41:20 +0900381
382void symbols__insert(struct rb_root *symbols, struct symbol *sym);
383void symbols__fixup_duplicate(struct rb_root *symbols);
384void symbols__fixup_end(struct rb_root *symbols);
385void __map_groups__fixup_end(struct map_groups *mg, enum map_type type);
386
John Kacur8b40f522009-09-24 18:02:18 +0200387#endif /* __PERF_SYMBOL */