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.

Dependency Surface

Detected Declarations

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

Implementation Notes