tools/perf/util/dso.h
Source file repositories/reference/linux-study-clean/tools/perf/util/dso.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/dso.h- Extension
.h- Size
- 24930 bytes
- Lines
- 945
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/refcount.hlinux/types.hlinux/rbtree.hsys/types.hstdbool.hstdio.hlinux/bitops.hbuild-id.hdebuginfo.hmutex.hinternal/rc_check.h
Detected Declarations
struct machinestruct mapstruct perf_envstruct dso_idstruct dso_cachestruct dso_datastruct dso_bpf_progstruct auxtrace_cachestruct Dwflstruct kmod_pathenum dso_binary_typeenum dso_space_typeenum dso_swap_typeenum dso_data_statusenum dso_data_status_seenenum dso_typeenum dso_load_errnofunction dso__set_a2lfunction dso__set_libdwfunction dso__a2l_failsfunction dso__set_a2l_failsfunction dso__adjust_symbolsfunction dso__set_adjust_symbolsfunction dso__annotate_warnedfunction dso__set_annotate_warnedfunction dso__debuginfo_warnedfunction dso__set_debuginfo_warnedfunction dso__auxtrace_warnedfunction dso__set_auxtrace_warnedfunction dso__set_auxtrace_cachefunction dso__has_srclinefunction dso__set_has_srclinefunction dso__compfunction dso__set_compfunction dso__db_idfunction dso__set_db_idfunction dso__set_dsosfunction dso__header_build_idfunction dso__set_header_build_idfunction dso__hitfunction dso__set_hitfunction dso__has_build_idfunction dso__is_64_bitfunction dso__set_is_64_bitfunction dso__is_kmodfunction dso__set_is_kmodfunction dso__kernelfunction dso__set_kernel
Annotated Snippet
struct dso_id {
/* Data related to the mmap2 event or read from /proc/pid/maps. */
struct {
u32 maj;
u32 min;
u64 ino;
u64 ino_generation;
};
/** @mmap2_valid: Are the maj, min and ino fields valid? */
bool mmap2_valid;
/**
* @mmap2_ino_generation_valid: Is the ino_generation valid? Generally
* false for /proc/pid/maps mmap event.
*/
bool mmap2_ino_generation_valid;
/**
* @build_id: A possibly populated build_id. build_id__is_defined checks
* whether it is populated.
*/
struct build_id build_id;
};
struct dso_cache {
struct rb_node rb_node;
u64 offset;
u64 size;
char data[];
};
struct dso_data {
struct rb_root cache;
struct list_head open_entry;
#ifdef REFCNT_CHECKING
struct dso *dso;
#endif
int fd;
int status;
u32 status_seen;
u64 file_size;
#ifdef HAVE_LIBUNWIND_SUPPORT
u64 elf_base_addr;
u64 debug_frame_offset;
u64 eh_frame_hdr_addr;
u64 eh_frame_hdr_offset;
#endif
};
struct dso_bpf_prog {
u32 id;
u32 sub_id;
struct perf_env *env;
};
struct auxtrace_cache;
DECLARE_RC_STRUCT(dso) {
struct mutex lock;
struct dsos *dsos;
struct rb_root_cached symbols;
struct symbol **symbol_names;
size_t symbol_names_len;
struct rb_root_cached inlined_nodes;
struct rb_root_cached srclines;
struct rb_root data_types;
struct rb_root global_vars;
struct {
u64 addr;
struct symbol *symbol;
} last_find_result;
u64 text_offset;
u64 text_end;
const char *short_name;
const char *long_name;
void *a2l;
void *libdw;
char *symsrc_filename;
struct nsinfo *nsinfo;
struct auxtrace_cache *auxtrace_cache;
union { /* Tool specific area */
void *priv;
u64 db_id;
};
/* bpf prog information */
struct dso_bpf_prog bpf_prog;
/* dso data file */
struct dso_data data;
struct dso_id id;
unsigned int a2l_fails;
int comp;
Annotation
- Immediate include surface: `linux/refcount.h`, `linux/types.h`, `linux/rbtree.h`, `sys/types.h`, `stdbool.h`, `stdio.h`, `linux/bitops.h`, `build-id.h`.
- Detected declarations: `struct machine`, `struct map`, `struct perf_env`, `struct dso_id`, `struct dso_cache`, `struct dso_data`, `struct dso_bpf_prog`, `struct auxtrace_cache`, `struct Dwfl`, `struct kmod_path`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.