diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-07-14 07:27:31 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-07-14 08:01:59 -0400 |
commit | 1b870fa5573e260bc74d19f381ab0dd971a8d8e7 (patch) | |
tree | b69d78017e58e7d341c4d56603ce21d488d09c75 /arch | |
parent | 84e7051c0bc1f2a13101553959b3a9d9a8e24939 (diff) | |
download | linux-stable-1b870fa5573e260bc74d19f381ab0dd971a8d8e7.tar.gz linux-stable-1b870fa5573e260bc74d19f381ab0dd971a8d8e7.tar.bz2 linux-stable-1b870fa5573e260bc74d19f381ab0dd971a8d8e7.zip |
kvm: stats: tell userspace which values are boolean
Some of the statistics values exported by KVM are always only 0 or 1.
It can be useful to export this fact to userspace so that it can track
them specially (for example by polling the value every now and then to
compute a % of time spent in a specific state).
Therefore, add "boolean value" as a new "unit". While it is not exactly
a unit, it walks and quacks like one. In particular, using the type
would be wrong because boolean values could be instantaneous or peak
values (e.g. "is the rmap allocated?") or even two-bucket histograms
(e.g. "number of posted vs. non-posted interrupt injections").
Suggested-by: Amneesh Singh <natto@weirdnatto.in>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 26d0cac32f73..0c3e85e8fce9 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -298,7 +298,7 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = { STATS_DESC_COUNTER(VCPU, directed_yield_successful), STATS_DESC_COUNTER(VCPU, preemption_reported), STATS_DESC_COUNTER(VCPU, preemption_other), - STATS_DESC_ICOUNTER(VCPU, guest_mode) + STATS_DESC_IBOOLEAN(VCPU, guest_mode) }; const struct kvm_stats_header kvm_vcpu_stats_header = { |