diff options
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r-- | tools/perf/util/symbol.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index fd5b70ea2981..07de8fea2f48 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <libgen.h> | 13 | #include <libgen.h> |
14 | #include "build-id.h" | 14 | #include "build-id.h" |
15 | 15 | ||
16 | #ifdef LIBELF_SUPPORT | 16 | #ifdef HAVE_LIBELF_SUPPORT |
17 | #include <libelf.h> | 17 | #include <libelf.h> |
18 | #include <gelf.h> | 18 | #include <gelf.h> |
19 | #endif | 19 | #endif |
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include "dso.h" | 22 | #include "dso.h" |
23 | 23 | ||
24 | #ifdef HAVE_CPLUS_DEMANGLE | 24 | #ifdef HAVE_CPLUS_DEMANGLE_SUPPORT |
25 | extern char *cplus_demangle(const char *, int); | 25 | extern char *cplus_demangle(const char *, int); |
26 | 26 | ||
27 | static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i) | 27 | static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i) |
@@ -46,7 +46,7 @@ static inline char *bfd_demangle(void __maybe_unused *v, | |||
46 | * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; | 46 | * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP; |
47 | * for newer versions we can use mmap to reduce memory usage: | 47 | * for newer versions we can use mmap to reduce memory usage: |
48 | */ | 48 | */ |
49 | #ifdef LIBELF_MMAP | 49 | #ifdef HAVE_LIBELF_MMAP_SUPPORT |
50 | # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP | 50 | # define PERF_ELF_C_READ_MMAP ELF_C_READ_MMAP |
51 | #else | 51 | #else |
52 | # define PERF_ELF_C_READ_MMAP ELF_C_READ | 52 | # define PERF_ELF_C_READ_MMAP ELF_C_READ |
@@ -85,6 +85,7 @@ struct symbol_conf { | |||
85 | unsigned short priv_size; | 85 | unsigned short priv_size; |
86 | unsigned short nr_events; | 86 | unsigned short nr_events; |
87 | bool try_vmlinux_path, | 87 | bool try_vmlinux_path, |
88 | ignore_vmlinux, | ||
88 | show_kernel_path, | 89 | show_kernel_path, |
89 | use_modules, | 90 | use_modules, |
90 | sort_by_name, | 91 | sort_by_name, |
@@ -178,7 +179,7 @@ struct symsrc { | |||
178 | int fd; | 179 | int fd; |
179 | enum dso_binary_type type; | 180 | enum dso_binary_type type; |
180 | 181 | ||
181 | #ifdef LIBELF_SUPPORT | 182 | #ifdef HAVE_LIBELF_SUPPORT |
182 | Elf *elf; | 183 | Elf *elf; |
183 | GElf_Ehdr ehdr; | 184 | GElf_Ehdr ehdr; |
184 | 185 | ||
@@ -222,6 +223,9 @@ int sysfs__read_build_id(const char *filename, void *bf, size_t size); | |||
222 | int kallsyms__parse(const char *filename, void *arg, | 223 | int kallsyms__parse(const char *filename, void *arg, |
223 | int (*process_symbol)(void *arg, const char *name, | 224 | int (*process_symbol)(void *arg, const char *name, |
224 | char type, u64 start)); | 225 | char type, u64 start)); |
226 | int modules__parse(const char *filename, void *arg, | ||
227 | int (*process_module)(void *arg, const char *name, | ||
228 | u64 start)); | ||
225 | int filename__read_debuglink(const char *filename, char *debuglink, | 229 | int filename__read_debuglink(const char *filename, char *debuglink, |
226 | size_t size); | 230 | size_t size); |
227 | 231 | ||
@@ -252,4 +256,21 @@ typedef int (*mapfn_t)(u64 start, u64 len, u64 pgoff, void *data); | |||
252 | int file__read_maps(int fd, bool exe, mapfn_t mapfn, void *data, | 256 | int file__read_maps(int fd, bool exe, mapfn_t mapfn, void *data, |
253 | bool *is_64_bit); | 257 | bool *is_64_bit); |
254 | 258 | ||
259 | #define PERF_KCORE_EXTRACT "/tmp/perf-kcore-XXXXXX" | ||
260 | |||
261 | struct kcore_extract { | ||
262 | char *kcore_filename; | ||
263 | u64 addr; | ||
264 | u64 offs; | ||
265 | u64 len; | ||
266 | char extract_filename[sizeof(PERF_KCORE_EXTRACT)]; | ||
267 | int fd; | ||
268 | }; | ||
269 | |||
270 | int kcore_extract__create(struct kcore_extract *kce); | ||
271 | void kcore_extract__delete(struct kcore_extract *kce); | ||
272 | |||
273 | int kcore_copy(const char *from_dir, const char *to_dir); | ||
274 | int compare_proc_modules(const char *from, const char *to); | ||
275 | |||
255 | #endif /* __PERF_SYMBOL */ | 276 | #endif /* __PERF_SYMBOL */ |