tools/perf/util/annotate-data.h

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

File Facts

System
Linux kernel
Corpus path
tools/perf/util/annotate-data.h
Extension
.h
Size
8869 bytes
Lines
323
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 annotated_member {
	struct list_head node;
	struct list_head children;
	char *type_name;
	char *var_name;
	int offset;
	int size;
};

/**
 * struct type_hist_entry - Histogram entry per offset
 * @nr_samples: Number of samples
 * @period: Count of event
 */
struct type_hist_entry {
	int nr_samples;
	u64 period;
};

/**
 * struct type_hist - Type histogram for each event
 * @nr_samples: Total number of samples in this data type
 * @period: Total count of the event in this data type
 * @offset: Array of histogram entry
 */
struct type_hist {
	u64			nr_samples;
	u64			period;
	struct type_hist_entry	addr[];
};

/**
 * struct annotated_data_type - Data type to profile
 * @node: RB-tree node for dso->type_tree
 * @self: Actual type information
 * @nr_histogram: Number of histogram entries
 * @histograms: An array of pointers to histograms
 *
 * This represents a data type accessed by samples in the profile data.
 */
struct annotated_data_type {
	struct rb_node node;
	struct annotated_member self;
	int nr_histograms;
	struct type_hist **histograms;
};

extern struct annotated_data_type unknown_type;
extern struct annotated_data_type stackop_type;
extern struct annotated_data_type canary_type;

/**
 * struct data_loc_info - Data location information
 * @arch: CPU architecture info
 * @thread: Thread info
 * @ms: Map and Symbol info
 * @ip: Instruction address
 * @var_addr: Data address (for global variables)
 * @cpumode: CPU execution mode
 * @op: Instruction operand location (regs and offset)
 * @di: Debug info
 * @fbreg: Frame base register
 * @fb_cfa: Whether the frame needs to check CFA
 * @type_offset: Final offset in the type
 */
struct data_loc_info {
	/* These are input field, should be filled by caller */
	const struct arch *arch;
	struct thread *thread;
	struct map_symbol *ms;
	u64 ip;
	u64 var_addr;
	u8 cpumode;
	struct annotated_op_loc *op;
	struct debuginfo *di;

	/* These are used internally */
	int fbreg;
	bool fb_cfa;

	/* This is for the result */
	int type_offset;
};

/**
 * struct annotated_data_stat - Debug statistics
 * @total: Total number of entry
 * @no_sym: No symbol or map found
 * @no_insn: Failed to get disasm line
 * @no_insn_ops: The instruction has no operands

Annotation

Implementation Notes