*/
# define VIR_DOMAIN_STATS_CPU_CACHE_MONITOR_SUFFIX_BANK_SUFFIX_BYTES ".bytes"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_CURRENT:
+ *
+ * The memory in kiB currently used as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_CURRENT "balloon.current"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_MAXIMUM:
+ *
+ * The maximum memory in kiB allowed as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_MAXIMUM "balloon.maximum"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_SWAP_IN:
+ *
+ * The amount of data read from swap space (in KiB) as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_SWAP_IN "balloon.swap_in"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_SWAP_OUT:
+ *
+ * The amount of memory written out to swap space (in KiB) as unsigned long
+ * long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_SWAP_OUT "balloon.swap_out"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_MAJOR_FAULT:
+ *
+ * The number of page faults when disk IO was required as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_MAJOR_FAULT "balloon.major_fault"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_MINOR_FAULT:
+ *
+ * The number of other page faults as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_MINOR_FAULT "balloon.minor_fault"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_UNUSED:
+ *
+ * The amount of memory left unused by the system (in KiB) as unsigned long
+ * long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_UNUSED "balloon.unused"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_AVAILABLE:
+ *
+ * The amount of usable memory as seen by the domain (in KiB) as unsigned long
+ * long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_AVAILABLE "balloon.available"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_RSS:
+ *
+ * Resident Set Size of running domain's process (in KiB) as unsigned long
+ * long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_RSS "balloon.rss"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_USABLE:
+ *
+ * The amount of memory which can be reclaimed by balloon without causing host
+ * swapping (in KiB) as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_USABLE "balloon.usable"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_LAST_UPDATE:
+ *
+ * Timestamp of the last update of statistics (in seconds) as unsigned long
+ * long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_LAST_UPDATE "balloon.last-update"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_DISK_CACHES:
+ *
+ * The amount of memory that can be reclaimed without additional I/O,
+ * typically disk (in KiB) as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_DISK_CACHES "balloon.disk_caches"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_HUGETLB_PGALLOC:
+ *
+ * The number of successful huge page allocations from inside the domain via
+ * virtio balloon as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_HUGETLB_PGALLOC "balloon.hugetlb_pgalloc"
+
+/**
+ * VIR_DOMAIN_STATS_BALLOON_HUGETLB_PGFAIL:
+ *
+ * The number of failed huge page allocations from inside the domain via
+ * virtio balloon as unsigned long long.
+ *
+ * Since: 11.2.0
+ */
+# define VIR_DOMAIN_STATS_BALLOON_HUGETLB_PGFAIL "balloon.hugetlb_pgfail"
+
/**
* virDomainStatsTypes:
*
*
* VIR_DOMAIN_STATS_BALLOON:
* Return memory balloon device information.
- * The typed parameter keys are in this format:
- *
- * "balloon.current" - the memory in kiB currently used
- * as unsigned long long.
- * "balloon.maximum" - the maximum memory in kiB allowed
- * as unsigned long long.
- * "balloon.swap_in" - the amount of data read from swap space (in KiB)
- * as unsigned long long
- * "balloon.swap_out" - the amount of memory written out to swap space
- * (in KiB) as unsigned long long
- * "balloon.major_fault" - the number of page faults when disk IO was
- * required as unsigned long long
- * "balloon.minor_fault" - the number of other page faults
- * as unsigned long long
- * "balloon.unused" - the amount of memory left unused by the system
- * (in KiB) as unsigned long long
- * "balloon.available" - the amount of usable memory as seen by the domain
- * (in KiB) as unsigned long long
- * "balloon.rss" - Resident Set Size of running domain's process
- * (in KiB) as unsigned long long
- * "balloon.usable" - the amount of memory which can be reclaimed by balloon
- * without causing host swapping (in KiB)
- * as unsigned long long
- * "balloon.last-update" - timestamp of the last update of statistics
- * (in seconds) as unsigned long long
- * "balloon.disk_caches" - the amount of memory that can be reclaimed
- * without additional I/O, typically disk (in KiB)
- * as unsigned long long
- * "balloon.hugetlb_pgalloc" - the number of successful huge page allocations
- * from inside the domain via virtio balloon
- * as unsigned long long
- * "balloon.hugetlb_pgfail" - the number of failed huge page allocations
- * from inside the domain via virtio balloon
- * as unsigned long long
+ * The VIR_DOMAIN_STATS_BALLOON_* constants define the known typed
+ * parameter keys.
*
* VIR_DOMAIN_STATS_VCPU:
* Return virtual CPU statistics.
cur_balloon = dom->def->mem.cur_balloon;
}
- virTypedParamListAddULLong(params, cur_balloon, "balloon.current");
- virTypedParamListAddULLong(params, virDomainDefGetMemoryTotal(dom->def), "balloon.maximum");
+ virTypedParamListAddULLong(params, cur_balloon,
+ VIR_DOMAIN_STATS_BALLOON_CURRENT);
+ virTypedParamListAddULLong(params, virDomainDefGetMemoryTotal(dom->def),
+ VIR_DOMAIN_STATS_BALLOON_MAXIMUM);
if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom))
return;
if (nr_stats < 0)
return;
-#define STORE_MEM_RECORD(TAG, NAME) \
+#define STORE_MEM_RECORD(TAG) \
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ ##TAG) \
- virTypedParamListAddULLong(params, stats[i].val, "balloon." NAME);
+ virTypedParamListAddULLong(params, stats[i].val, VIR_DOMAIN_STATS_BALLOON_ ##TAG)
for (i = 0; i < nr_stats; i++) {
- STORE_MEM_RECORD(SWAP_IN, "swap_in")
- STORE_MEM_RECORD(SWAP_OUT, "swap_out")
- STORE_MEM_RECORD(MAJOR_FAULT, "major_fault")
- STORE_MEM_RECORD(MINOR_FAULT, "minor_fault")
- STORE_MEM_RECORD(UNUSED, "unused")
- STORE_MEM_RECORD(AVAILABLE, "available")
- STORE_MEM_RECORD(RSS, "rss")
- STORE_MEM_RECORD(LAST_UPDATE, "last-update")
- STORE_MEM_RECORD(USABLE, "usable")
- STORE_MEM_RECORD(DISK_CACHES, "disk_caches")
- STORE_MEM_RECORD(HUGETLB_PGALLOC, "hugetlb_pgalloc")
- STORE_MEM_RECORD(HUGETLB_PGFAIL, "hugetlb_pgfail")
+ STORE_MEM_RECORD(SWAP_IN);
+ STORE_MEM_RECORD(SWAP_OUT);
+ STORE_MEM_RECORD(MAJOR_FAULT);
+ STORE_MEM_RECORD(MINOR_FAULT);
+ STORE_MEM_RECORD(UNUSED);
+ STORE_MEM_RECORD(AVAILABLE);
+ STORE_MEM_RECORD(RSS);
+ STORE_MEM_RECORD(LAST_UPDATE);
+ STORE_MEM_RECORD(USABLE);
+ STORE_MEM_RECORD(DISK_CACHES);
+ STORE_MEM_RECORD(HUGETLB_PGALLOC);
+ STORE_MEM_RECORD(HUGETLB_PGFAIL);
}
#undef STORE_MEM_RECORD