tools/perf/util/hist.h
Source file repositories/reference/linux-study-clean/tools/perf/util/hist.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/hist.h- Extension
.h- Size
- 23294 bytes
- Lines
- 842
- 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/rbtree.hlinux/types.hcallchain.hcolor.hevents_stats.hevsel.hmap_symbol.hmem-events.hmutex.hsample.hspark.hstat.h../ui/keysyms.h
Detected Declarations
struct addr_locationstruct mem_infostruct kvm_infostruct branch_infostruct branch_stackstruct block_infostruct ui_progressstruct threadstruct dsostruct he_mem_statstruct histsstruct hist_entry_iterstruct hist_iter_opsstruct hist_entry_iterstruct res_samplestruct he_statstruct namespace_idstruct hist_entry_diffstruct hist_entry_opsstruct hist_entrystruct perf_hppstruct perf_hpp_fmtstruct hists_evselstruct perf_hppstruct perf_hpp_fmtstruct perf_hpp_liststruct perf_hpp_list_nodestruct evliststruct hist_browser_timerstruct block_histstruct optionenum hist_filterenum hist_columnenum perf_hpp_fmt_typeenum rstypeenum hierarchy_move_dirfunction hist_entry__has_callchainsfunction hist_entry__has_pairsfunction hist_entry__add_pairfunction hists__has_filterfunction hist_entry__get_percent_limitfunction hists__has_callchainsfunction perf_hpp__column_registerfunction perf_hpp__register_sort_fieldfunction perf_hpp__prepend_sort_fieldfunction perf_hpp__should_skipfunction advance_hppfunction perf_hpp__use_color
Annotated Snippet
struct he_mem_stat {
/* meaning of entries depends on enum mem_stat_type */
u64 entries[MEM_STAT_LEN];
};
struct hists {
struct rb_root_cached entries_in_array[2];
struct rb_root_cached *entries_in;
struct rb_root_cached entries;
struct rb_root_cached entries_collapsed;
u64 nr_entries;
u64 nr_non_filtered_entries;
u64 callchain_period;
u64 callchain_non_filtered_period;
u64 callchain_latency;
u64 callchain_non_filtered_latency;
struct thread *thread_filter;
const struct dso *dso_filter;
const char *uid_filter_str;
const char *symbol_filter_str;
unsigned long *parallelism_filter;
struct mutex lock;
struct hists_stats stats;
u64 event_stream;
u16 col_len[HISTC_NR_COLS];
bool has_callchains;
int socket_filter;
struct perf_hpp_list *hpp_list;
struct list_head hpp_formats;
int nr_hpp_node;
int nr_mem_stats;
enum mem_stat_type *mem_stat_types;
struct he_mem_stat *mem_stat_total;
};
#define hists__has(__h, __f) (__h)->hpp_list->__f
struct hist_entry_iter;
struct hist_iter_ops {
int (*prepare_entry)(struct hist_entry_iter *, struct addr_location *);
int (*add_single_entry)(struct hist_entry_iter *, struct addr_location *);
int (*next_entry)(struct hist_entry_iter *, struct addr_location *);
int (*add_next_entry)(struct hist_entry_iter *, struct addr_location *);
int (*finish_entry)(struct hist_entry_iter *, struct addr_location *);
};
struct hist_entry_iter {
int total;
int curr;
struct evsel *evsel;
struct perf_sample *sample;
struct hist_entry *he;
struct symbol *parent;
struct mem_info *mi;
struct branch_info *bi;
struct hist_entry **he_cache;
const struct hist_iter_ops *ops;
/* user-defined callback function (optional) */
int (*add_entry_cb)(struct hist_entry_iter *iter,
struct addr_location *al, bool single, void *arg);
bool hide_unresolved;
};
extern const struct hist_iter_ops hist_iter_normal;
extern const struct hist_iter_ops hist_iter_branch;
extern const struct hist_iter_ops hist_iter_mem;
extern const struct hist_iter_ops hist_iter_cumulative;
struct res_sample {
u64 time;
int cpu;
int tid;
};
struct he_stat {
u64 period;
/*
* Period re-scaled from CPU time to wall-clock time (divided by the
* parallelism at the time of the sample). This represents effect of
* the event on latency rather than CPU consumption.
*/
u64 latency;
u64 period_sys;
u64 period_us;
u64 period_guest_sys;
u64 period_guest_us;
Annotation
- Immediate include surface: `linux/rbtree.h`, `linux/types.h`, `callchain.h`, `color.h`, `events_stats.h`, `evsel.h`, `map_symbol.h`, `mem-events.h`.
- Detected declarations: `struct addr_location`, `struct mem_info`, `struct kvm_info`, `struct branch_info`, `struct branch_stack`, `struct block_info`, `struct ui_progress`, `struct thread`, `struct dso`, `struct he_mem_stat`.
- 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.