]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Expose more guest stats for vROPS to report the exact physical memory
authorOliver Kurth <okurth@vmware.com>
Wed, 29 Aug 2018 20:29:43 +0000 (13:29 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 29 Aug 2018 20:29:43 +0000 (13:29 -0700)
stats as the guest OS UI does.

Windows:
guest.mem.modifiedPages (Win32_PerfRawData_PerfOS_Memory#ModifiedPageListBytes)
guest.mem.standby.core (Win32_PerfRawData_PerfOS_Memory#StandbyCacheCoreBytes)
guest.mem.standby.normal (Win32_PerfRawData_PerfOS_Memory#StandbyCacheNormalPriorityBytes)
guest.mem.standby.reserve (Win32_PerfRawData_PerfOS_Memory#StandbyCacheReserveBytes)

Linux:
guest.mem.total (/proc/meminfo#MemTotal)
guest.mem.buffers (/proc/meminfo#Buffers)
guest.mem.cached (/proc/meminfo#Cached)
guest.mem.slabReclaim (/proc/meminfo#SReclaimable)
guest.mem.available (/proc/meminfo#MemAvailable since Linux 3.14, emulated by VMTools for kernels 2.6.27+)

open-vm-tools/services/plugins/guestInfo/perfMonLinux.c

index b1323b7db41daca854f0b439b9ffa7b142756573..fa2344b0f6e0a60329a48f82eedcf169b2c23f49 100644 (file)
@@ -90,13 +90,14 @@ GuestInfoQuery guestInfoQuerySpecTable[] = {
 
    DECLARE_STAT(&gReleased,  NULL,            FALSE, NULL,              GuestStatID_MemNeededReservation,      GuestUnitsKiB,             GuestTypeUint64),
 
-   DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "MemAvailable",    GuestStatID_Linux_MemAvailable,        GuestUnitsKiB,             GuestTypeUint64),
+   DECLARE_STAT(&gReleased,  MEMINFO_FILE,    FALSE, "MemAvailable",    GuestStatID_Linux_MemAvailable,        GuestUnitsKiB,             GuestTypeUint64),
+   DECLARE_STAT(&gReleased,  MEMINFO_FILE,    FALSE, "SReclaimable",    GuestStatID_Linux_MemSlabReclaim,      GuestUnitsKiB,             GuestTypeUint64),
+   DECLARE_STAT(&gReleased,  MEMINFO_FILE,    FALSE, "Buffers",         GuestStatID_Linux_MemBuffers,          GuestUnitsKiB,             GuestTypeUint64),
+   DECLARE_STAT(&gReleased,  MEMINFO_FILE,    FALSE, "Cached",          GuestStatID_Linux_MemCached,           GuestUnitsKiB,             GuestTypeUint64),
+   DECLARE_STAT(&gReleased,  MEMINFO_FILE,    FALSE, "MemTotal",        GuestStatID_Linux_MemTotal,            GuestUnitsKiB,             GuestTypeUint64),
+
    DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "Inactive(file)",  GuestStatID_Linux_MemInactiveFile,     GuestUnitsKiB,             GuestTypeUint64),
-   DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "SReclaimable",    GuestStatID_Linux_MemSlabReclaim,      GuestUnitsKiB,             GuestTypeUint64),
-   DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "Buffers",         GuestStatID_Linux_MemBuffers,          GuestUnitsKiB,             GuestTypeUint64),
-   DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "Cached",          GuestStatID_Linux_MemCached,           GuestUnitsKiB,             GuestTypeUint64),
    DECLARE_STAT(&gInternal,  ZONEINFO_FILE,   TRUE,  "low",             GuestStatID_Linux_LowWaterMark,        GuestUnitsPages,           GuestTypeUint64),
-   DECLARE_STAT(&gInternal,  MEMINFO_FILE,    FALSE, "MemTotal",        GuestStatID_Linux_MemTotal,            GuestUnitsKiB,             GuestTypeUint64),
 
 #if PUBLISH_EXPERIMENTAL_STATS
    DECLARE_STAT(&gExperimental,  MEMINFO_FILE,    FALSE, "SwapTotal",       GuestStatID_SwapFilesCurrent,          GuestUnitsKiB,             GuestTypeUint64),
@@ -1230,6 +1231,10 @@ GuestInfoDeriveMemNeeded(GuestInfoCollector *collector)  // IN/OUT:
          if ((int64)memAvailable < 0) {
             memAvailable = 0;
          }
+
+         GuestInfoStoreStatByID(GuestStatID_Linux_MemAvailable,
+                                collector,
+                                memAvailable);
       }
    }