tools/perf/util/stat.h

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

File Facts

System
Linux kernel
Corpus path
tools/perf/util/stat.h
Extension
.h
Size
5752 bytes
Lines
210
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 stats {
	double n, mean, M2;
	u64 max, min;
};

/* hold aggregated event info */
struct perf_stat_aggr {
	/* aggregated values */
	struct perf_counts_values	counts;
	/* number of entries (CPUs) aggregated */
	int				nr;
	/* whether any entry has failed to read/process event */
	bool				failed;
	/* to mark this data is processed already */
	bool				used;
};

/* per-evsel event stats */
struct perf_stat_evsel {
	/* used for repeated runs */
	struct stats		 res_stats;
	/* number of allocated 'aggr' */
	int			 nr_aggr;
	/* aggregated event values */
	struct perf_stat_aggr	*aggr;
	/* used for group read */
	u64			*group_data;
};

enum aggr_mode {
	AGGR_NONE,
	AGGR_GLOBAL,
	AGGR_SOCKET,
	AGGR_DIE,
	AGGR_CLUSTER,
	AGGR_CACHE,
	AGGR_CORE,
	AGGR_THREAD,
	AGGR_UNSET,
	AGGR_NODE,
	AGGR_MAX
};

typedef struct aggr_cpu_id (*aggr_get_id_t)(struct perf_stat_config *config, struct perf_cpu cpu);

struct perf_stat_config {
	enum aggr_mode		 aggr_mode;
	u32			 aggr_level;
	bool			 scale;
	bool			 no_inherit;
	bool			 identifier;
	bool			 csv_output;
	bool			 json_output;
	bool			 interval_clear;
	bool			 metric_only;
	bool			 null_run;
	bool			 ru_display;
	bool			 big_num;
	bool			 hybrid_merge;
	bool			 walltime_run_table;
	bool			 all_kernel;
	bool			 all_user;
	bool			 percore_show_thread;
	bool			 summary;
	bool			 no_csv_summary;
	bool			 metric_no_group;
	bool			 metric_no_merge;
	bool			 metric_no_threshold;
	bool			 hardware_aware_grouping;
	bool			 stop_read_counter;
	bool			 iostat_run;
	char			 *user_requested_cpu_list;
	bool			 system_wide;
	FILE			*output;
	unsigned int		 interval;
	unsigned int		 timeout;
	unsigned int		 unit_width;
	unsigned int		 metric_only_len;
	int			 times;
	int			 run_count;
	int			 print_free_counters_hint;
	const char		*csv_sep;
	struct stats		*walltime_nsecs_stats;
	struct rusage		 ru_data;
	struct cpu_aggr_map	*aggr_map;
	aggr_get_id_t		 aggr_get_id;
	struct cpu_aggr_map	*cpus_aggr_map;
	u64			*walltime_run;
	int			 ctl_fd;
	int			 ctl_fd_ack;

Annotation

Implementation Notes