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.
- 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
errno.hlinux/compiler.hlinux/rbtree.hlinux/types.hdwarf-regs.hannotate.hdebuginfo.h
Detected Declarations
struct annotated_op_locstruct debuginfostruct evselstruct hist_browser_timerstruct hist_entrystruct map_symbolstruct threadstruct annotated_memberstruct type_hist_entrystruct type_histstruct annotated_data_typestruct data_loc_infostruct annotated_data_statstruct type_state_regstruct type_state_stackstruct type_stateenum type_state_kindfunction find_data_typefunction annotated_data_type__update_samplesfunction annotated_data_type__tree_deletefunction annotated_data_type__get_member_namefunction hist_entry__annotate_data_tui
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
- Immediate include surface: `errno.h`, `linux/compiler.h`, `linux/rbtree.h`, `linux/types.h`, `dwarf-regs.h`, `annotate.h`, `debuginfo.h`.
- Detected declarations: `struct annotated_op_loc`, `struct debuginfo`, `struct evsel`, `struct hist_browser_timer`, `struct hist_entry`, `struct map_symbol`, `struct thread`, `struct annotated_member`, `struct type_hist_entry`, `struct type_hist`.
- 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.