All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keirf@google.com>
To: kvm@vger.kernel.org
Cc: will@kernel.org, Keir Fraser <keirf@google.com>
Subject: [PATCH kvmtool 2/2] stat: Add descriptions for new virtio_balloon stat types
Date: Fri, 20 May 2022 14:37:06 +0000	[thread overview]
Message-ID: <20220520143706.550169-3-keirf@google.com> (raw)
In-Reply-To: <20220520143706.550169-1-keirf@google.com>

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>
---
 builtin-stat.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/builtin-stat.c b/builtin-stat.c
index 5d6407e..876e96a 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);
-- 
2.36.1.124.g0e6072fb45-goog


  parent reply	other threads:[~2022-05-20 14:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 14:37 [PATCH kvmtool 0/2] Fixes for virtio_balloon stats printing Keir Fraser
2022-05-20 14:37 ` [PATCH kvmtool 1/2] virtio/balloon: Fix a crash when collecting stats Keir Fraser
2022-05-20 14:37 ` Keir Fraser [this message]
2022-05-20 20:51 ` [PATCH kvmtool 0/2] Fixes for virtio_balloon stats printing Will Deacon
2022-05-23 14:42   ` Andre Przywara
2022-05-23 15:06     ` Keir Fraser
2022-05-23 15:13       ` Andre Przywara
2022-05-23 15:49         ` Alexandru Elisei
2022-05-23 16:35           ` Keir Fraser
2022-05-23 17:07             ` Alexandru Elisei
2022-05-23 17:39               ` Andre Przywara
2022-05-24  8:40                 ` Alexandru Elisei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220520143706.550169-3-keirf@google.com \
    --to=keirf@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.