summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/kvm_util_base.h
diff options
context:
space:
mode:
authorBen Gardon <bgardon@google.com>2022-06-14 00:25:23 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-24 11:51:51 +0300
commit83f6e109f562063ab7a1f54d99bcab2858b09ead (patch)
treec9ad1742db44dd9d4d597cd28ce94e94e266180e /tools/testing/selftests/kvm/include/kvm_util_base.h
parentb774da3f2e5761cb85881ce62eb6dc97d15396c4 (diff)
downloadlinux-83f6e109f562063ab7a1f54d99bcab2858b09ead.tar.xz
KVM: selftests: Cache binary stats metadata for duration of test
In order to improve performance across multiple reads of VM stats, cache the stats metadata in the VM struct. Signed-off-by: Ben Gardon <bgardon@google.com> Message-Id: <20220613212523.3436117-11-bgardon@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util_base.h')
-rw-r--r--tools/testing/selftests/kvm/include/kvm_util_base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
index fd2b52850b29..b78e3c7a2566 100644
--- a/tools/testing/selftests/kvm/include/kvm_util_base.h
+++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
@@ -84,6 +84,11 @@ struct kvm_vm {
vm_vaddr_t idt;
vm_vaddr_t handlers;
uint32_t dirty_ring_size;
+
+ /* Cache of information for binary stats interface */
+ int stats_fd;
+ struct kvm_stats_header stats_header;
+ struct kvm_stats_desc *stats_desc;
};