1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/refcount.h>
6 #include <linux/types.h>
7 #include <linux/rbtree.h>
11 #include <linux/bitops.h>
14 #include <internal/rc_check.h>
20 #define DSO__NAME_KALLSYMS "[kernel.kallsyms]"
21 #define DSO__NAME_KCORE "[kernel.kcore]"
23 enum dso_binary_type
{
24 DSO_BINARY_TYPE__KALLSYMS
= 0,
25 DSO_BINARY_TYPE__GUEST_KALLSYMS
,
26 DSO_BINARY_TYPE__VMLINUX
,
27 DSO_BINARY_TYPE__GUEST_VMLINUX
,
28 DSO_BINARY_TYPE__JAVA_JIT
,
29 DSO_BINARY_TYPE__DEBUGLINK
,
30 DSO_BINARY_TYPE__BUILD_ID_CACHE
,
31 DSO_BINARY_TYPE__BUILD_ID_CACHE_DEBUGINFO
,
32 DSO_BINARY_TYPE__FEDORA_DEBUGINFO
,
33 DSO_BINARY_TYPE__UBUNTU_DEBUGINFO
,
34 DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO
,
35 DSO_BINARY_TYPE__BUILDID_DEBUGINFO
,
36 DSO_BINARY_TYPE__SYSTEM_PATH_DSO
,
37 DSO_BINARY_TYPE__GUEST_KMODULE
,
38 DSO_BINARY_TYPE__GUEST_KMODULE_COMP
,
39 DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE
,
40 DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP
,
41 DSO_BINARY_TYPE__KCORE
,
42 DSO_BINARY_TYPE__GUEST_KCORE
,
43 DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO
,
44 DSO_BINARY_TYPE__BPF_PROG_INFO
,
45 DSO_BINARY_TYPE__BPF_IMAGE
,
47 DSO_BINARY_TYPE__NOT_FOUND
,
53 DSO_SPACE__KERNEL_GUEST
62 enum dso_data_status
{
63 DSO_DATA_STATUS_ERROR
= -1,
64 DSO_DATA_STATUS_UNKNOWN
= 0,
65 DSO_DATA_STATUS_OK
= 1,
68 enum dso_data_status_seen
{
69 DSO_DATA_STATUS_SEEN_ITRACE
,
80 DSO_LOAD_ERRNO__SUCCESS
= 0,
83 * Choose an arbitrary negative big number not to clash with standard
84 * errno since SUS requires the errno has distinct positive values.
85 * See 'Issue 6' in the link below.
87 * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
89 __DSO_LOAD_ERRNO__START
= -10000,
91 DSO_LOAD_ERRNO__INTERNAL_ERROR
= __DSO_LOAD_ERRNO__START
,
93 /* for symsrc__init() */
94 DSO_LOAD_ERRNO__INVALID_ELF
,
95 DSO_LOAD_ERRNO__CANNOT_READ_BUILDID
,
96 DSO_LOAD_ERRNO__MISMATCHING_BUILDID
,
98 /* for decompress_kmodule */
99 DSO_LOAD_ERRNO__DECOMPRESSION_FAILURE
,
101 __DSO_LOAD_ERRNO__END
,
104 #define DSO__SWAP(dso, type, val) \
107 enum dso_swap_type ___dst = dso__needs_swap(dso); \
108 BUG_ON(___dst == DSO_SWAP__UNSET); \
109 if (___dst == DSO_SWAP__YES) { \
110 switch (sizeof(____r)) { \
112 ____r = bswap_16(val); \
115 ____r = bswap_32(val); \
118 ____r = bswap_64(val); \
127 #define DSO__DATA_CACHE_SIZE 4096
128 #define DSO__DATA_CACHE_MASK ~(DSO__DATA_CACHE_SIZE - 1)
131 * Data about backing storage DSO, comes from PERF_RECORD_MMAP2 meta events
141 struct rb_node rb_node
;
148 struct rb_root cache
;
149 struct list_head open_entry
;
150 #ifdef REFCNT_CHECKING
158 u64 debug_frame_offset
;
159 u64 eh_frame_hdr_addr
;
160 u64 eh_frame_hdr_offset
;
163 struct dso_bpf_prog
{
166 struct perf_env
*env
;
169 struct auxtrace_cache
;
171 DECLARE_RC_STRUCT(dso
) {
174 struct rb_root_cached symbols
;
175 struct symbol
**symbol_names
;
176 size_t symbol_names_len
;
177 struct rb_root_cached inlined_nodes
;
178 struct rb_root_cached srclines
;
179 struct rb_root data_types
;
180 struct rb_root global_vars
;
184 struct symbol
*symbol
;
189 const char *short_name
;
190 const char *long_name
;
192 char *symsrc_filename
;
193 #if defined(__powerpc__)
194 void *dwfl
; /* DWARF debug info */
196 struct nsinfo
*nsinfo
;
197 struct auxtrace_cache
*auxtrace_cache
;
198 union { /* Tool specific area */
202 /* bpf prog information */
203 struct dso_bpf_prog bpf_prog
;
205 struct dso_data data
;
207 unsigned int a2l_fails
;
210 enum dso_load_errno load_errno
;
213 enum dso_binary_type symtab_type
:8;
214 enum dso_binary_type binary_type
:8;
215 enum dso_space_type kernel
:2;
216 enum dso_swap_type needs_swap
:2;
220 u8 header_build_id
:1;
223 u8 annotate_warned
:1;
224 u8 auxtrace_warned
:1;
225 u8 short_name_allocated
:1;
226 u8 long_name_allocated
:1;
234 /* dso__for_each_symbol - iterate over the symbols of given type
236 * @dso: the 'struct dso *' in which symbols are iterated
237 * @pos: the 'struct symbol *' to use as a loop cursor
238 * @n: the 'struct rb_node *' to use as a temporary storage
240 #define dso__for_each_symbol(dso, pos, n) \
241 symbols__for_each_entry(dso__symbols(dso), pos, n)
243 static inline void *dso__a2l(const struct dso
*dso
)
245 return RC_CHK_ACCESS(dso
)->a2l
;
248 static inline void dso__set_a2l(struct dso
*dso
, void *val
)
250 RC_CHK_ACCESS(dso
)->a2l
= val
;
253 static inline unsigned int dso__a2l_fails(const struct dso
*dso
)
255 return RC_CHK_ACCESS(dso
)->a2l_fails
;
258 static inline void dso__set_a2l_fails(struct dso
*dso
, unsigned int val
)
260 RC_CHK_ACCESS(dso
)->a2l_fails
= val
;
263 static inline bool dso__adjust_symbols(const struct dso
*dso
)
265 return RC_CHK_ACCESS(dso
)->adjust_symbols
;
268 static inline void dso__set_adjust_symbols(struct dso
*dso
, bool val
)
270 RC_CHK_ACCESS(dso
)->adjust_symbols
= val
;
273 static inline bool dso__annotate_warned(const struct dso
*dso
)
275 return RC_CHK_ACCESS(dso
)->annotate_warned
;
278 static inline void dso__set_annotate_warned(struct dso
*dso
)
280 RC_CHK_ACCESS(dso
)->annotate_warned
= 1;
283 static inline bool dso__auxtrace_warned(const struct dso
*dso
)
285 return RC_CHK_ACCESS(dso
)->auxtrace_warned
;
288 static inline void dso__set_auxtrace_warned(struct dso
*dso
)
290 RC_CHK_ACCESS(dso
)->auxtrace_warned
= 1;
293 static inline struct auxtrace_cache
*dso__auxtrace_cache(struct dso
*dso
)
295 return RC_CHK_ACCESS(dso
)->auxtrace_cache
;
298 static inline void dso__set_auxtrace_cache(struct dso
*dso
, struct auxtrace_cache
*cache
)
300 RC_CHK_ACCESS(dso
)->auxtrace_cache
= cache
;
303 static inline struct build_id
*dso__bid(struct dso
*dso
)
305 return &RC_CHK_ACCESS(dso
)->bid
;
308 static inline const struct build_id
*dso__bid_const(const struct dso
*dso
)
310 return &RC_CHK_ACCESS(dso
)->bid
;
313 static inline struct dso_bpf_prog
*dso__bpf_prog(struct dso
*dso
)
315 return &RC_CHK_ACCESS(dso
)->bpf_prog
;
318 static inline bool dso__has_build_id(const struct dso
*dso
)
320 return RC_CHK_ACCESS(dso
)->has_build_id
;
323 static inline void dso__set_has_build_id(struct dso
*dso
)
325 RC_CHK_ACCESS(dso
)->has_build_id
= true;
328 static inline bool dso__has_srcline(const struct dso
*dso
)
330 return RC_CHK_ACCESS(dso
)->has_srcline
;
333 static inline void dso__set_has_srcline(struct dso
*dso
, bool val
)
335 RC_CHK_ACCESS(dso
)->has_srcline
= val
;
338 static inline int dso__comp(const struct dso
*dso
)
340 return RC_CHK_ACCESS(dso
)->comp
;
343 static inline void dso__set_comp(struct dso
*dso
, int comp
)
345 RC_CHK_ACCESS(dso
)->comp
= comp
;
348 static inline struct dso_data
*dso__data(struct dso
*dso
)
350 return &RC_CHK_ACCESS(dso
)->data
;
353 static inline u64
dso__db_id(const struct dso
*dso
)
355 return RC_CHK_ACCESS(dso
)->db_id
;
358 static inline void dso__set_db_id(struct dso
*dso
, u64 db_id
)
360 RC_CHK_ACCESS(dso
)->db_id
= db_id
;
363 static inline struct dsos
*dso__dsos(struct dso
*dso
)
365 return RC_CHK_ACCESS(dso
)->dsos
;
368 static inline void dso__set_dsos(struct dso
*dso
, struct dsos
*dsos
)
370 RC_CHK_ACCESS(dso
)->dsos
= dsos
;
373 static inline bool dso__header_build_id(struct dso
*dso
)
375 return RC_CHK_ACCESS(dso
)->header_build_id
;
378 static inline void dso__set_header_build_id(struct dso
*dso
, bool val
)
380 RC_CHK_ACCESS(dso
)->header_build_id
= val
;
383 static inline bool dso__hit(const struct dso
*dso
)
385 return RC_CHK_ACCESS(dso
)->hit
;
388 static inline void dso__set_hit(struct dso
*dso
)
390 RC_CHK_ACCESS(dso
)->hit
= 1;
393 static inline struct dso_id
*dso__id(struct dso
*dso
)
395 return &RC_CHK_ACCESS(dso
)->id
;
398 static inline const struct dso_id
*dso__id_const(const struct dso
*dso
)
400 return &RC_CHK_ACCESS(dso
)->id
;
403 static inline struct rb_root_cached
*dso__inlined_nodes(struct dso
*dso
)
405 return &RC_CHK_ACCESS(dso
)->inlined_nodes
;
408 static inline bool dso__is_64_bit(const struct dso
*dso
)
410 return RC_CHK_ACCESS(dso
)->is_64_bit
;
413 static inline void dso__set_is_64_bit(struct dso
*dso
, bool is
)
415 RC_CHK_ACCESS(dso
)->is_64_bit
= is
;
418 static inline bool dso__is_kmod(const struct dso
*dso
)
420 return RC_CHK_ACCESS(dso
)->is_kmod
;
423 static inline void dso__set_is_kmod(struct dso
*dso
)
425 RC_CHK_ACCESS(dso
)->is_kmod
= 1;
428 static inline enum dso_space_type
dso__kernel(const struct dso
*dso
)
430 return RC_CHK_ACCESS(dso
)->kernel
;
433 static inline void dso__set_kernel(struct dso
*dso
, enum dso_space_type kernel
)
435 RC_CHK_ACCESS(dso
)->kernel
= kernel
;
438 static inline u64
dso__last_find_result_addr(const struct dso
*dso
)
440 return RC_CHK_ACCESS(dso
)->last_find_result
.addr
;
443 static inline void dso__set_last_find_result_addr(struct dso
*dso
, u64 addr
)
445 RC_CHK_ACCESS(dso
)->last_find_result
.addr
= addr
;
448 static inline struct symbol
*dso__last_find_result_symbol(const struct dso
*dso
)
450 return RC_CHK_ACCESS(dso
)->last_find_result
.symbol
;
453 static inline void dso__set_last_find_result_symbol(struct dso
*dso
, struct symbol
*symbol
)
455 RC_CHK_ACCESS(dso
)->last_find_result
.symbol
= symbol
;
458 static inline enum dso_load_errno
*dso__load_errno(struct dso
*dso
)
460 return &RC_CHK_ACCESS(dso
)->load_errno
;
463 static inline void dso__set_loaded(struct dso
*dso
)
465 RC_CHK_ACCESS(dso
)->loaded
= true;
468 static inline struct mutex
*dso__lock(struct dso
*dso
)
470 return &RC_CHK_ACCESS(dso
)->lock
;
473 static inline const char *dso__long_name(const struct dso
*dso
)
475 return RC_CHK_ACCESS(dso
)->long_name
;
478 static inline bool dso__long_name_allocated(const struct dso
*dso
)
480 return RC_CHK_ACCESS(dso
)->long_name_allocated
;
483 static inline void dso__set_long_name_allocated(struct dso
*dso
, bool allocated
)
485 RC_CHK_ACCESS(dso
)->long_name_allocated
= allocated
;
488 static inline u16
dso__long_name_len(const struct dso
*dso
)
490 return RC_CHK_ACCESS(dso
)->long_name_len
;
493 static inline const char *dso__name(const struct dso
*dso
)
495 return RC_CHK_ACCESS(dso
)->name
;
498 static inline enum dso_swap_type
dso__needs_swap(const struct dso
*dso
)
500 return RC_CHK_ACCESS(dso
)->needs_swap
;
503 static inline void dso__set_needs_swap(struct dso
*dso
, enum dso_swap_type type
)
505 RC_CHK_ACCESS(dso
)->needs_swap
= type
;
508 static inline struct nsinfo
*dso__nsinfo(struct dso
*dso
)
510 return RC_CHK_ACCESS(dso
)->nsinfo
;
513 static inline const struct nsinfo
*dso__nsinfo_const(const struct dso
*dso
)
515 return RC_CHK_ACCESS(dso
)->nsinfo
;
518 static inline struct nsinfo
**dso__nsinfo_ptr(struct dso
*dso
)
520 return &RC_CHK_ACCESS(dso
)->nsinfo
;
523 void dso__set_nsinfo(struct dso
*dso
, struct nsinfo
*nsi
);
525 static inline u8
dso__rel(const struct dso
*dso
)
527 return RC_CHK_ACCESS(dso
)->rel
;
530 static inline void dso__set_rel(struct dso
*dso
, u8 rel
)
532 RC_CHK_ACCESS(dso
)->rel
= rel
;
535 static inline const char *dso__short_name(const struct dso
*dso
)
537 return RC_CHK_ACCESS(dso
)->short_name
;
540 static inline bool dso__short_name_allocated(const struct dso
*dso
)
542 return RC_CHK_ACCESS(dso
)->short_name_allocated
;
545 static inline void dso__set_short_name_allocated(struct dso
*dso
, bool allocated
)
547 RC_CHK_ACCESS(dso
)->short_name_allocated
= allocated
;
550 static inline u16
dso__short_name_len(const struct dso
*dso
)
552 return RC_CHK_ACCESS(dso
)->short_name_len
;
555 static inline struct rb_root_cached
*dso__srclines(struct dso
*dso
)
557 return &RC_CHK_ACCESS(dso
)->srclines
;
560 static inline struct rb_root
*dso__data_types(struct dso
*dso
)
562 return &RC_CHK_ACCESS(dso
)->data_types
;
565 static inline struct rb_root
*dso__global_vars(struct dso
*dso
)
567 return &RC_CHK_ACCESS(dso
)->global_vars
;
570 static inline struct rb_root_cached
*dso__symbols(struct dso
*dso
)
572 return &RC_CHK_ACCESS(dso
)->symbols
;
575 static inline struct symbol
**dso__symbol_names(struct dso
*dso
)
577 return RC_CHK_ACCESS(dso
)->symbol_names
;
580 static inline void dso__set_symbol_names(struct dso
*dso
, struct symbol
**names
)
582 RC_CHK_ACCESS(dso
)->symbol_names
= names
;
585 static inline size_t dso__symbol_names_len(struct dso
*dso
)
587 return RC_CHK_ACCESS(dso
)->symbol_names_len
;
590 static inline void dso__set_symbol_names_len(struct dso
*dso
, size_t len
)
592 RC_CHK_ACCESS(dso
)->symbol_names_len
= len
;
595 static inline const char *dso__symsrc_filename(const struct dso
*dso
)
597 return RC_CHK_ACCESS(dso
)->symsrc_filename
;
600 static inline void dso__set_symsrc_filename(struct dso
*dso
, char *val
)
602 RC_CHK_ACCESS(dso
)->symsrc_filename
= val
;
605 static inline void dso__free_symsrc_filename(struct dso
*dso
)
607 zfree(&RC_CHK_ACCESS(dso
)->symsrc_filename
);
610 static inline enum dso_binary_type
dso__symtab_type(const struct dso
*dso
)
612 return RC_CHK_ACCESS(dso
)->symtab_type
;
615 static inline void dso__set_symtab_type(struct dso
*dso
, enum dso_binary_type bt
)
617 RC_CHK_ACCESS(dso
)->symtab_type
= bt
;
620 static inline u64
dso__text_end(const struct dso
*dso
)
622 return RC_CHK_ACCESS(dso
)->text_end
;
625 static inline void dso__set_text_end(struct dso
*dso
, u64 val
)
627 RC_CHK_ACCESS(dso
)->text_end
= val
;
630 static inline u64
dso__text_offset(const struct dso
*dso
)
632 return RC_CHK_ACCESS(dso
)->text_offset
;
635 static inline void dso__set_text_offset(struct dso
*dso
, u64 val
)
637 RC_CHK_ACCESS(dso
)->text_offset
= val
;
640 int dso_id__cmp(const struct dso_id
*a
, const struct dso_id
*b
);
641 bool dso_id__empty(const struct dso_id
*id
);
643 struct dso
*dso__new_id(const char *name
, const struct dso_id
*id
);
644 struct dso
*dso__new(const char *name
);
645 void dso__delete(struct dso
*dso
);
647 int dso__cmp_id(struct dso
*a
, struct dso
*b
);
648 void dso__set_short_name(struct dso
*dso
, const char *name
, bool name_allocated
);
649 void dso__set_long_name(struct dso
*dso
, const char *name
, bool name_allocated
);
650 void __dso__inject_id(struct dso
*dso
, const struct dso_id
*id
);
652 int dso__name_len(const struct dso
*dso
);
654 struct dso
*dso__get(struct dso
*dso
);
655 void dso__put(struct dso
*dso
);
657 static inline void __dso__zput(struct dso
**dso
)
663 #define dso__zput(dso) __dso__zput(&dso)
665 bool dso__loaded(const struct dso
*dso
);
667 static inline bool dso__has_symbols(const struct dso
*dso
)
669 return !RB_EMPTY_ROOT(&RC_CHK_ACCESS(dso
)->symbols
.rb_root
);
672 char *dso__filename_with_chroot(const struct dso
*dso
, const char *filename
);
674 bool dso__sorted_by_name(const struct dso
*dso
);
675 void dso__set_sorted_by_name(struct dso
*dso
);
676 void dso__sort_by_name(struct dso
*dso
);
678 void dso__set_build_id(struct dso
*dso
, struct build_id
*bid
);
679 bool dso__build_id_equal(const struct dso
*dso
, struct build_id
*bid
);
680 void dso__read_running_kernel_build_id(struct dso
*dso
,
681 struct machine
*machine
);
682 int dso__kernel_module_get_build_id(struct dso
*dso
, const char *root_dir
);
684 char dso__symtab_origin(const struct dso
*dso
);
685 int dso__read_binary_type_filename(const struct dso
*dso
, enum dso_binary_type type
,
686 char *root_dir
, char *filename
, size_t size
);
687 bool is_kernel_module(const char *pathname
, int cpumode
);
688 bool dso__needs_decompress(struct dso
*dso
);
689 int dso__decompress_kmodule_fd(struct dso
*dso
, const char *name
);
690 int dso__decompress_kmodule_path(struct dso
*dso
, const char *name
,
691 char *pathname
, size_t len
);
692 int filename__decompress(const char *name
, char *pathname
,
693 size_t len
, int comp
, int *err
);
695 #define KMOD_DECOMP_NAME "/tmp/perf-kmod-XXXXXX"
696 #define KMOD_DECOMP_LEN sizeof(KMOD_DECOMP_NAME)
704 int __kmod_path__parse(struct kmod_path
*m
, const char *path
,
707 #define kmod_path__parse(__m, __p) __kmod_path__parse(__m, __p, false)
708 #define kmod_path__parse_name(__m, __p) __kmod_path__parse(__m, __p, true)
710 void dso__set_module_info(struct dso
*dso
, struct kmod_path
*m
,
711 struct machine
*machine
);
714 * The dso__data_* external interface provides following functions:
719 * dso__data_read_offset
720 * dso__data_read_addr
721 * dso__data_write_cache_offs
722 * dso__data_write_cache_addr
724 * Please refer to the dso.c object code for each function and
725 * arguments documentation. Following text tries to explain the
726 * dso file descriptor caching.
728 * The dso__data* interface allows caching of opened file descriptors
729 * to speed up the dso data accesses. The idea is to leave the file
730 * descriptor opened ideally for the whole life of the dso object.
732 * The current usage of the dso__data_* interface is as follows:
735 * int fd = dso__data_get_fd(dso, machine);
738 * dso__data_put_fd(dso);
742 * n = dso__data_read_offset(dso_0, &machine, 0, buf, BUFSIZE);
743 * n = dso__data_read_addr(dso_0, &machine, 0, buf, BUFSIZE);
745 * Eventually close DSO's fd:
746 * dso__data_close(dso);
748 * It is not necessary to close the DSO object data file. Each time new
749 * DSO data file is opened, the limit (RLIMIT_NOFILE/2) is checked. Once
750 * it is crossed, the oldest opened DSO object is closed.
752 * The dso__delete function calls close_dso function to ensure the
753 * data file descriptor gets closed/unmapped before the dso object
758 int dso__data_get_fd(struct dso
*dso
, struct machine
*machine
);
759 void dso__data_put_fd(struct dso
*dso
);
760 void dso__data_close(struct dso
*dso
);
762 int dso__data_file_size(struct dso
*dso
, struct machine
*machine
);
763 off_t
dso__data_size(struct dso
*dso
, struct machine
*machine
);
764 ssize_t
dso__data_read_offset(struct dso
*dso
, struct machine
*machine
,
765 u64 offset
, u8
*data
, ssize_t size
);
766 ssize_t
dso__data_read_addr(struct dso
*dso
, struct map
*map
,
767 struct machine
*machine
, u64 addr
,
768 u8
*data
, ssize_t size
);
769 bool dso__data_status_seen(struct dso
*dso
, enum dso_data_status_seen by
);
770 ssize_t
dso__data_write_cache_offs(struct dso
*dso
, struct machine
*machine
,
771 u64 offset
, const u8
*data
, ssize_t size
);
772 ssize_t
dso__data_write_cache_addr(struct dso
*dso
, struct map
*map
,
773 struct machine
*machine
, u64 addr
,
774 const u8
*data
, ssize_t size
);
776 struct map
*dso__new_map(const char *name
);
777 struct dso
*machine__findnew_kernel(struct machine
*machine
, const char *name
,
778 const char *short_name
, int dso_type
);
780 void dso__reset_find_symbol_cache(struct dso
*dso
);
782 size_t dso__fprintf_symbols_by_name(struct dso
*dso
, FILE *fp
);
783 size_t dso__fprintf(struct dso
*dso
, FILE *fp
);
785 static inline enum dso_binary_type
dso__binary_type(const struct dso
*dso
)
787 return RC_CHK_ACCESS(dso
)->binary_type
;
790 static inline void dso__set_binary_type(struct dso
*dso
, enum dso_binary_type bt
)
792 RC_CHK_ACCESS(dso
)->binary_type
= bt
;
795 static inline bool dso__is_vmlinux(const struct dso
*dso
)
797 enum dso_binary_type bt
= dso__binary_type(dso
);
799 return bt
== DSO_BINARY_TYPE__VMLINUX
|| bt
== DSO_BINARY_TYPE__GUEST_VMLINUX
;
802 static inline bool dso__is_kcore(const struct dso
*dso
)
804 enum dso_binary_type bt
= dso__binary_type(dso
);
806 return bt
== DSO_BINARY_TYPE__KCORE
|| bt
== DSO_BINARY_TYPE__GUEST_KCORE
;
809 static inline bool dso__is_kallsyms(const struct dso
*dso
)
811 return RC_CHK_ACCESS(dso
)->kernel
&& RC_CHK_ACCESS(dso
)->long_name
[0] != '/';
814 bool dso__is_object_file(const struct dso
*dso
);
816 void dso__free_a2l(struct dso
*dso
);
818 enum dso_type
dso__type(struct dso
*dso
, struct machine
*machine
);
820 int dso__strerror_load(struct dso
*dso
, char *buf
, size_t buflen
);
822 void reset_fd_limit(void);
824 u64
dso__find_global_type(struct dso
*dso
, u64 addr
);
825 u64
dso__findnew_global_type(struct dso
*dso
, u64 addr
, u64 offset
);
827 /* Check if dso name is of format "/tmp/perf-%d.map" */
828 bool perf_pid_map_tid(const char *dso_name
, int *tid
);
829 bool is_perf_pid_map_name(const char *dso_name
);
831 #endif /* __PERF_DSO */