tools/perf/util/disasm.h

Source file repositories/reference/linux-study-clean/tools/perf/util/disasm.h

File Facts

System
Linux kernel
Corpus path
tools/perf/util/disasm.h
Extension
.h
Size
5332 bytes
Lines
171
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 e_machine_and_e_flags {
	uint32_t e_flags;
	uint16_t e_machine;
};

struct arch {
	/** @name: name such as "x86" or "powerpc". */
	const char		*name;
	const struct ins	*instructions;
	size_t			nr_instructions;
	size_t			nr_instructions_allocated;
	const char		*insn_suffix;
	unsigned int		model;
	unsigned int		family;
	/** @id: ELF machine and flags associated with arch. */
	struct e_machine_and_e_flags id;
	bool			sorted_instructions;
	struct		{
		char comment_char;
		char skip_functions_char;
		char register_char;
		char memory_ref_char;
		char imm_char;
	} objdump;
	bool		(*ins_is_fused)(const struct arch *arch, const char *ins1,
					const char *ins2);
	const struct ins_ops  *(*associate_instruction_ops)(struct arch *arch, const char *name);
#ifdef HAVE_LIBDW_SUPPORT
	void		(*update_insn_state)(struct type_state *state,
				struct data_loc_info *dloc, Dwarf_Die *cu_die,
				struct disasm_line *dl);
#endif
};

struct ins {
	const char     *name;
	const struct ins_ops *ops;
};

struct ins_operands {
	char	*raw;
	struct {
		char	*raw;
		char	*name;
		struct symbol *sym;
		u64	addr;
		s64	offset;
		bool	offset_avail;
		bool	outside;
		bool	multi_regs;
		bool	mem_ref;
	} target;
	union {
		struct {
			char	*raw;
			char	*name;
			u64	addr;
			bool	multi_regs;
			bool	mem_ref;
		} source;
		struct {
			struct ins	    ins;
			struct ins_operands *ops;
		} locked;
		struct {
			char	*raw_comment;
			char	*raw_func_start;
		} jump;
	};
};

struct ins_ops {
	void (*free)(struct ins_operands *ops);
	int (*parse)(const struct arch *arch, struct ins_operands *ops, struct map_symbol *ms,
			struct disasm_line *dl);
	int (*scnprintf)(const struct ins *ins, char *bf, size_t size,
			 struct ins_operands *ops, int max_ins_name);
	bool is_jump;
	bool is_call;
};

struct annotate_args {
	const struct arch	  *arch;
	struct map_symbol	  *ms;
	struct annotation_options *options;
	s64			  offset;
	char			  *line;
	int			  line_nr;
	char			  *fileloc;
};

Annotation

Implementation Notes