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.
- 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
tool.hsort.hstat.hsymbol.hrecord.herrno.hstdlib.hlinux/zalloc.h
Detected Declarations
struct evselstruct evliststruct perf_sessionstruct event_keystruct kvm_infostruct kvm_event_statsstruct perf_kvm_statstruct kvm_eventstruct child_event_opsstruct kvm_events_opsstruct exit_reasons_tablestruct perf_kvm_statstruct kvm_reg_events_opsfunction kvm_add_default_arch_eventfunction kvm_info__putfunction __kvm_info__zput
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
- Immediate include surface: `tool.h`, `sort.h`, `stat.h`, `symbol.h`, `record.h`, `errno.h`, `stdlib.h`, `linux/zalloc.h`.
- Detected declarations: `struct evsel`, `struct evlist`, `struct perf_session`, `struct event_key`, `struct kvm_info`, `struct kvm_event_stats`, `struct perf_kvm_stat`, `struct kvm_event`, `struct child_event_ops`, `struct kvm_events_ops`.
- 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.