aboutsummaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-18 16:24:12 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:53:04 +0200
commitba1389b7a04de07e6231693b7ebb34f5b5d1a3e6 (patch)
tree536139f6e1d3a918b13a9c44f2144c52366a55bb /drivers/kvm/kvm.h
parentf2b5756bb3fbdca912c4890e444c18650389d8ae (diff)
KVM: Extend stats support for VM stats
This is in addition to the current virtual cpu statistics. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 5a8a9af3593..d3171f9c9c0 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -231,7 +231,7 @@ struct kvm_pio_request {
int rep;
};
-struct kvm_stat {
+struct kvm_vcpu_stat {
u32 pf_fixed;
u32 pf_guest;
u32 tlb_flush;
@@ -342,7 +342,7 @@ void kvm_io_bus_register_dev(struct kvm_io_bus *bus,
wait_queue_head_t wq; \
int sigset_active; \
sigset_t sigset; \
- struct kvm_stat stat; \
+ struct kvm_vcpu_stat stat; \
KVM_VCPU_MMIO
struct kvm_mem_alias {
@@ -361,6 +361,9 @@ struct kvm_memory_slot {
int user_alloc;
};
+struct kvm_vm_stat {
+};
+
struct kvm {
struct mutex lock; /* protects everything except vcpus */
int naliases;
@@ -387,6 +390,7 @@ struct kvm {
int round_robin_prev_vcpu;
unsigned int tss_addr;
struct page *apic_access_page;
+ struct kvm_vm_stat stat;
};
static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
@@ -809,9 +813,15 @@ static inline u32 get_rdx_init_val(void)
#define TSS_REDIRECTION_SIZE (256 / 8)
#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1)
+enum kvm_stat_kind {
+ KVM_STAT_VM,
+ KVM_STAT_VCPU,
+};
+
struct kvm_stats_debugfs_item {
const char *name;
int offset;
+ enum kvm_stat_kind kind;
struct dentry *dentry;
};
extern struct kvm_stats_debugfs_item debugfs_entries[];