Commit 0193cc90 authored by Jing Zhang's avatar Jing Zhang Committed by Paolo Bonzini
Browse files

KVM: stats: Separate generic stats from architecture specific ones



Generic KVM stats are those collected in architecture independent code
or those supported by all architectures; put all generic statistics in
a separate structure.  This ensures that they are defined the same way
in the statistics API which is being added, removing duplication among
different architectures in the declaration of the descriptors.

No functional change intended.

Reviewed-by: default avatarDavid Matlack <dmatlack@google.com>
Reviewed-by: default avatarRicardo Koller <ricarkol@google.com>
Reviewed-by: default avatarKrish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: default avatarJing Zhang <jingzhangos@google.com>
Message-Id: <20210618222709.1858088-2-jingzhangos@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 6c6e166b
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -556,16 +556,11 @@ static inline bool __vcpu_write_sys_reg_to_cpu(u64 val, int reg)
}

struct kvm_vm_stat {
	u64 remote_tlb_flush;
	struct kvm_vm_stat_generic generic;
};

struct kvm_vcpu_stat {
	u64 halt_successful_poll;
	u64 halt_attempted_poll;
	u64 halt_poll_success_ns;
	u64 halt_poll_fail_ns;
	u64 halt_poll_invalid;
	u64 halt_wakeup;
	struct kvm_vcpu_stat_generic generic;
	u64 hvc_exit_stat;
	u64 wfe_exit_stat;
	u64 wfi_exit_stat;
+6 −6
Original line number Diff line number Diff line
@@ -29,18 +29,18 @@
#include "trace.h"

struct kvm_stats_debugfs_item debugfs_entries[] = {
	VCPU_STAT("halt_successful_poll", halt_successful_poll),
	VCPU_STAT("halt_attempted_poll", halt_attempted_poll),
	VCPU_STAT("halt_poll_invalid", halt_poll_invalid),
	VCPU_STAT("halt_wakeup", halt_wakeup),
	VCPU_STAT("halt_successful_poll", generic.halt_successful_poll),
	VCPU_STAT("halt_attempted_poll", generic.halt_attempted_poll),
	VCPU_STAT("halt_poll_invalid", generic.halt_poll_invalid),
	VCPU_STAT("halt_wakeup", generic.halt_wakeup),
	VCPU_STAT("hvc_exit_stat", hvc_exit_stat),
	VCPU_STAT("wfe_exit_stat", wfe_exit_stat),
	VCPU_STAT("wfi_exit_stat", wfi_exit_stat),
	VCPU_STAT("mmio_exit_user", mmio_exit_user),
	VCPU_STAT("mmio_exit_kernel", mmio_exit_kernel),
	VCPU_STAT("exits", exits),
	VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns),
	VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns),
	VCPU_STAT("halt_poll_success_ns", generic.halt_poll_success_ns),
	VCPU_STAT("halt_poll_fail_ns", generic.halt_poll_fail_ns),
	{ NULL }
};

+2 −7
Original line number Diff line number Diff line
@@ -109,10 +109,11 @@ static inline bool kvm_is_error_hva(unsigned long addr)
}

struct kvm_vm_stat {
	u64 remote_tlb_flush;
	struct kvm_vm_stat_generic generic;
};

struct kvm_vcpu_stat {
	struct kvm_vcpu_stat_generic generic;
	u64 wait_exits;
	u64 cache_exits;
	u64 signal_exits;
@@ -142,12 +143,6 @@ struct kvm_vcpu_stat {
#ifdef CONFIG_CPU_LOONGSON64
	u64 vz_cpucfg_exits;
#endif
	u64 halt_successful_poll;
	u64 halt_attempted_poll;
	u64 halt_poll_success_ns;
	u64 halt_poll_fail_ns;
	u64 halt_poll_invalid;
	u64 halt_wakeup;
};

struct kvm_arch_memory_slot {
+6 −6
Original line number Diff line number Diff line
@@ -68,12 +68,12 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
#ifdef CONFIG_CPU_LOONGSON64
	VCPU_STAT("vz_cpucfg", vz_cpucfg_exits),
#endif
	VCPU_STAT("halt_successful_poll", halt_successful_poll),
	VCPU_STAT("halt_attempted_poll", halt_attempted_poll),
	VCPU_STAT("halt_poll_invalid", halt_poll_invalid),
	VCPU_STAT("halt_wakeup", halt_wakeup),
	VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns),
	VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns),
	VCPU_STAT("halt_successful_poll", generic.halt_successful_poll),
	VCPU_STAT("halt_attempted_poll", generic.halt_attempted_poll),
	VCPU_STAT("halt_poll_invalid", generic.halt_poll_invalid),
	VCPU_STAT("halt_wakeup", generic.halt_wakeup),
	VCPU_STAT("halt_poll_success_ns", generic.halt_poll_success_ns),
	VCPU_STAT("halt_poll_fail_ns", generic.halt_poll_fail_ns),
	{NULL}
};

+2 −7
Original line number Diff line number Diff line
@@ -81,12 +81,13 @@ struct kvmppc_book3s_shadow_vcpu;
struct kvm_nested_guest;

struct kvm_vm_stat {
	u64 remote_tlb_flush;
	struct kvm_vm_stat_generic generic;
	u64 num_2M_pages;
	u64 num_1G_pages;
};

struct kvm_vcpu_stat {
	struct kvm_vcpu_stat_generic generic;
	u64 sum_exits;
	u64 mmio_exits;
	u64 signal_exits;
@@ -102,14 +103,8 @@ struct kvm_vcpu_stat {
	u64 emulated_inst_exits;
	u64 dec_exits;
	u64 ext_intr_exits;
	u64 halt_poll_success_ns;
	u64 halt_poll_fail_ns;
	u64 halt_wait_ns;
	u64 halt_successful_poll;
	u64 halt_attempted_poll;
	u64 halt_successful_wait;
	u64 halt_poll_invalid;
	u64 halt_wakeup;
	u64 dbell_exits;
	u64 gdbell_exits;
	u64 ld;
Loading