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.

Dependency Surface

Detected Declarations

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

Implementation Notes