diff options
author | Keir Fraser <keirf@google.com> | 2022-05-20 14:37:06 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-05-20 21:19:56 +0100 |
commit | bc77bf49df6e1e4ff095558cceb718293dd5b763 (patch) | |
tree | d6aa91e808ad4e55f082d9d74a93c68730a531c4 | |
parent | 3a13530ae99acead2174b4bc3ba76a768802fd98 (diff) | |
download | kvmtool-bc77bf49df6e1e4ff095558cceb718293dd5b763.tar.gz |
stat: Add descriptions for new virtio_balloon stat types
Unknown types would print the value with no descriptive text at all.
Add descriptions for all known stat types, and a default description
when the type is unknown.
Signed-off-by: Keir Fraser <keirf@google.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20220520143706.550169-3-keirf@google.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | builtin-stat.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/builtin-stat.c b/builtin-stat.c index 5d6407e6..876e96a3 100644 --- a/builtin-stat.c +++ b/builtin-stat.c @@ -83,11 +83,26 @@ static int do_memstat(const char *name, int sock) case VIRTIO_BALLOON_S_MINFLT: printf("The number of minor page faults that have occurred:"); break; + case VIRTIO_BALLOON_S_HTLB_PGALLOC: + printf("The number of successful HugeTLB allocations:"); + break; + case VIRTIO_BALLOON_S_HTLB_PGFAIL: + printf("The number of failed HugeTLB allocations:"); + break; case VIRTIO_BALLOON_S_MEMFREE: printf("The amount of memory not being used for any purpose (in bytes):"); break; case VIRTIO_BALLOON_S_MEMTOT: - printf("The total amount of memory available (in bytes):"); + printf("The total amount of memory (in bytes):"); + break; + case VIRTIO_BALLOON_S_AVAIL: + printf("The estimated available memory (in bytes):"); + break; + case VIRTIO_BALLOON_S_CACHES: + printf("The amount of memory in use for file caching (in bytes):"); + break; + default: + printf("Unknown memory statistic (ID %u): ", stats[i].tag); break; } printf("%llu\n", (unsigned long long)stats[i].val); |