tools/perf/util/kvm-stat.h

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

File Facts

System
Linux kernel
Corpus path
tools/perf/util/kvm-stat.h
Extension
.h
Size
6026 bytes
Lines
241
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 event_key {
	#define INVALID_KEY     (~0ULL)
	u64 key;
	int info;
	struct exit_reasons_table *exit_reasons;
};

struct kvm_info {
	char name[KVM_EVENT_NAME_LEN];
	refcount_t refcnt;
};

struct kvm_event_stats {
	u64 time;
	struct stats stats;
};

struct perf_kvm_stat;

struct kvm_event {
	struct list_head hash_entry;

	struct perf_kvm_stat *perf_kvm;
	struct event_key key;

	struct kvm_event_stats total;

	#define DEFAULT_VCPU_NUM 8
	int max_vcpu;
	struct kvm_event_stats *vcpu;

	struct hist_entry he;
};

struct child_event_ops {
	void (*get_key)(struct evsel *evsel,
			struct perf_sample *sample,
			struct event_key *key);
	const char *name;
};

struct kvm_events_ops {
	bool (*is_begin_event)(struct evsel *evsel,
			       struct perf_sample *sample,
			       struct event_key *key);
	bool (*is_end_event)(struct evsel *evsel,
			     struct perf_sample *sample, struct event_key *key);
	const struct child_event_ops *child_ops;
	void (*decode_key)(struct perf_kvm_stat *kvm, struct event_key *key,
			   char *decode);
	const char *name;
};

struct exit_reasons_table {
	unsigned long exit_code;
	const char *reason;
};

struct perf_kvm_stat {
	struct perf_tool    tool;
	struct record_opts  opts;
	struct evlist  *evlist;
	struct perf_session *session;

	const char *file_name;
	const char *report_event;
	const char *sort_key;
	int trace_vcpu;

	/* Used when process events */
	struct addr_location al;

	struct exit_reasons_table *exit_reasons;
	const char *exit_reasons_isa;

	const struct kvm_events_ops *events_ops;

	u64 total_time;
	u64 total_count;
	u64 lost_events;
	u64 duration;

	struct intlist *pid_list;

	int timerfd;
	unsigned int display_time;
	bool live;
	bool force;
	bool use_stdio;
};

Annotation

Implementation Notes