From: Oliver Kurth Date: Thu, 30 Nov 2017 23:17:27 +0000 (-0800) Subject: Remove guestStats that are beyond ESXi 6.0 U1 scope. X-Git-Tag: stable-10.2.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bf279de6298f999abf66079e7e824d5498abd31;p=thirdparty%2Fopen-vm-tools.git Remove guestStats that are beyond ESXi 6.0 U1 scope. The guestStats in R10 Tools release follow ESXi 6.0 U1 scope. Remove the guestStats that are not in scope for ESXi 6.0 U1. --- diff --git a/open-vm-tools/lib/include/guestStats.h b/open-vm-tools/lib/include/guestStats.h index d5af939cf..b6bad8246 100644 --- a/open-vm-tools/lib/include/guestStats.h +++ b/open-vm-tools/lib/include/guestStats.h @@ -49,9 +49,7 @@ #define GUESTMEMINFO_V5 5 /* - * Flags for GuestMemInfoLegacy - * - * !!! DON'T ADD/CHANGE FLAGS !!! + * Flags for legacy GuestMemInfo * * This is deprecated. All new values are returned via a GuestStat list. */ @@ -69,19 +67,16 @@ #define MEMINFO_HUGEPAGESTOTAL (1 << 10) #define MEMINFO_DEPRECATED10 (1 << 11) #define MEMINFO_DEPRECATED11 (1 << 12) -#define MEMINFO_MEMNEEDED (1 << 13) /* * Legacy GuestMemInfo structure. * - * !!! DON'T CHANGE IT !!! - * * It should stay the same to ensure binary compatibility. */ typedef #include "vmware_pack_begin.h" -struct GuestMemInfoLegacy { +struct GuestMemInfo { uint32 version; ///< MemInfo structure version. uint32 flags; ///< Indicates which stats are valid. uint64 memTotal; ///< Total physical memory in Kb. @@ -90,7 +85,7 @@ struct GuestMemInfoLegacy { uint64 deprecated2[2]; ///< No longer used. } #include "vmware_pack_end.h" -GuestMemInfoLegacy; +GuestMemInfo; /* * A stat begins with a header. The header has a mask which says what data @@ -244,7 +239,7 @@ typedef enum { /* * Defined stat IDs for guest tools builtin query. - * See vmx/vigorapi/guestStats.java for documentation + * See vmx/vigorapi/GuestStats.java for documentation * * NOTE: These IDs are relative to GUEST_TOOLS_NAMESPACE * NOTE: DO NOT re-order or remove the IDs. IDs can only be added to the end, @@ -252,7 +247,6 @@ typedef enum { * of bumping the namespace version. */ #define GUEST_STAT_TOOLS_IDS \ - /* 2015u1 stats */ \ DEFINE_GUEST_STAT(GuestStatID_Invalid, 0, "__INVALID__") \ DEFINE_GUEST_STAT(GuestStatID_None, 1, "__NONE__") \ DEFINE_GUEST_STAT(GuestStatID_ContextSwapRate, 2, "guest.contextSwapRate") \ @@ -266,56 +260,7 @@ typedef enum { DEFINE_GUEST_STAT(GuestStatID_PhysicalPageSize, 10, "guest.page.size") \ DEFINE_GUEST_STAT(GuestStatID_HugePageSize, 11, "guest.hugePage.size") \ DEFINE_GUEST_STAT(GuestStatID_Linux_HugePagesTotal, 12, "guest.hugePage.total") \ - /* 2016 stats */ \ - DEFINE_GUEST_STAT(GuestStatID_MemNeededReservation, 13, "guest.mem.neededReservation") \ - DEFINE_GUEST_STAT(GuestStatID_PageSwapInRate, 14, "guest.swap.pageInRate") \ - DEFINE_GUEST_STAT(GuestStatID_PageSwapOutRate, 15, "guest.swap.pageOutRate") \ - DEFINE_GUEST_STAT(GuestStatID_ProcessCreationRate, 16, "guest.processCreationRate") \ - DEFINE_GUEST_STAT(GuestStatID_SwapSpaceUsed, 17, "guest.swap.used") \ - DEFINE_GUEST_STAT(GuestStatID_SwapFilesCurrent, 18, "guest.swap.filesCurrent") \ - DEFINE_GUEST_STAT(GuestStatID_SwapFilesMax, 19, "guest.swap.filesMax") \ - DEFINE_GUEST_STAT(GuestStatID_ThreadCreationRate, 20, "guest.threadCreationRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_HugePagesFree, 21, "guest.hugePage.free") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_LowWaterMark, 22, "guest.mem.lowWaterMark") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemActive, 23, "guest.mem.active") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemActiveAnon, 24, "guest.mem.activeAnon") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemAvailable, 25, "guest.mem.available") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemBuffers, 26, "guest.mem.buffers") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemCached, 27, "guest.mem.cached") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemCommitted, 28, "guest.mem.committed") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemDirty, 29, "guest.mem.dirty") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemInactive, 30, "guest.mem.inactive") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemInactiveAnon, 31, "guest.mem.inactiveAnon") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemInactiveFile, 32, "guest.mem.inactiveFile") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemPinned, 33, "guest.mem.pinned") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemSlabReclaim, 34, "guest.mem.slabReclaim") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemSwapCached, 35, "guest.mem.swap.cached") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageDirectScanRate, 36, "guest.page.directScanRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageFaultRate, 37, "guest.page.faultRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageFreeRate, 38, "guest.page.freeRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageMajorFaultRate, 39, "guest.page.majorFaultRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageStealRate, 40, "guest.page.stealRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_PageSwapScanRate, 41, "guest.page.swapScanRate") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_Swappiness, 42, "guest.swappiness") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemModifiedPages, 43, "guest.mem.modifiedPages") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemAvailableToMm, 44, "guest.mem.availableToMm") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemStandbyCore, 45, "guest.mem.standby.core") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemStandbyNormal, 46, "guest.mem.standby.normal") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemStandbyReserve, 47, "guest.mem.standby.reserve") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemPagedPoolResident, 48, "guest.mem.pagedPool.resident") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemSystemCodeResident, 49, "guest.system.codeResident") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemSystemDriverResident, 50, "guest.system.driverResident") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemNonPagedPool, 51, "guest.mem.nonPagedPool.size") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemCache, 52, "guest.mem.cache") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_FreeSystemPtes, 53, "guest.system.freePtes") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemCommitLimit, 54, "guest.mem.commitLimit") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemCommitted, 55, "guest.mem.committed") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_MemPrivateWorkingSet, 56, "guest.mem.privateWorkingSet") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_DiskReadRate, 57, "guest.disk.readRate") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_DiskWriteRate, 58, "guest.disk.writeRate") \ - DEFINE_GUEST_STAT(GuestStatID_Windows_AutomaticSwapFileMax, 59, "guest.swap.automaticFileMax") \ - DEFINE_GUEST_STAT(GuestStatID_Linux_MemTotal, 60, "guest.mem.total") \ - DEFINE_GUEST_STAT(GuestStatID_Max, 61, "__MAX__") + DEFINE_GUEST_STAT(GuestStatID_Max, 13, "__MAX__") /* * Define stats enumeration diff --git a/open-vm-tools/services/plugins/guestInfo/guestInfoInt.h b/open-vm-tools/services/plugins/guestInfo/guestInfoInt.h index 58b8e4a20..21dc26cfd 100644 --- a/open-vm-tools/services/plugins/guestInfo/guestInfoInt.h +++ b/open-vm-tools/services/plugins/guestInfo/guestInfoInt.h @@ -32,6 +32,25 @@ #include "nicInfo.h" #include "dynbuf.h" +/* + * Internal stat IDs used by intermediate stats collected + * for computing derived stats. + * + * NOTE: These IDs should not be published to the host as + * these may change. + */ +#define GuestStatID_SwapSpaceUsed ((GuestStatToolsID) (GuestStatID_Max + 0)) +#define GuestStatID_SwapFilesCurrent ((GuestStatToolsID) (GuestStatID_Max + 1)) +#define GuestStatID_SwapFilesMax ((GuestStatToolsID) (GuestStatID_Max + 2)) +#define GuestStatID_Linux_LowWaterMark ((GuestStatToolsID) (GuestStatID_Max + 3)) +#define GuestStatID_Linux_MemAvailable ((GuestStatToolsID) (GuestStatID_Max + 4)) +#define GuestStatID_Linux_MemBuffers ((GuestStatToolsID) (GuestStatID_Max + 5)) +#define GuestStatID_Linux_MemCached ((GuestStatToolsID) (GuestStatID_Max + 6)) +#define GuestStatID_Linux_MemInactiveFile ((GuestStatToolsID) (GuestStatID_Max + 7)) +#define GuestStatID_Linux_MemSlabReclaim ((GuestStatToolsID) (GuestStatID_Max + 8)) +#define GuestStatID_Linux_MemTotal ((GuestStatToolsID) (GuestStatID_Max + 9)) +#define GuestStatID_Linux_Internal_Max ((GuestStatToolsID) (GuestStatID_Max + 10)) + extern int guestInfoPollInterval; Bool diff --git a/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c b/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c index d5ea95136..ca505fa45 100644 --- a/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c +++ b/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c @@ -42,9 +42,6 @@ #define ZONEINFO_FILE "/proc/zoneinfo" #define SWAPPINESS_FILE "/proc/sys/vm/swappiness" -#define PUBLISH_P1_2015_STATS 1 -#define PUBLISH_P1_2016_STATS 1 -#define PUBLISH_P2_STATS 1 /* * For now, all data collection is of uint64 values. Rates are always returned @@ -53,9 +50,8 @@ * TODO: Deal with collected and reported data types being different. */ -#define STAT_FLAG(x) PUBLISH_##x##_STATS #define DECLARE_STAT(collect, publish, file, isRegExp, locatorString, reportID, units, dataType) \ - { file, STAT_FLAG(collect), STAT_FLAG(publish), isRegExp, locatorString, reportID, units, dataType } + { file, collect, publish, isRegExp, locatorString, reportID, units, dataType } typedef struct { const char *sourceFile; @@ -69,54 +65,28 @@ typedef struct { } GuestInfoQuery; GuestInfoQuery guestInfoQuerySpecTable[] = { - DECLARE_STAT(P1_2015, P1_2015, MEMINFO_FILE, FALSE, "Hugepagesize", GuestStatID_HugePageSize, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, ZONEINFO_FILE,TRUE, "present", GuestStatID_MemPhysUsable, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, MEMINFO_FILE, FALSE, "MemFree", GuestStatID_MemFree, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, MEMINFO_FILE, FALSE, "Active(file)", GuestStatID_MemActiveFileCache, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, MEMINFO_FILE, FALSE, "SwapFree", GuestStatID_SwapSpaceRemaining, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, MEMINFO_FILE, FALSE, "HugePages_Total", GuestStatID_Linux_HugePagesTotal, GuestUnitsHugePages, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2015, VMSTAT_FILE, FALSE, "pgpgin", GuestStatID_PageInRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2015, P1_2015, VMSTAT_FILE, FALSE, "pgpgout", GuestStatID_PageOutRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2015, P1_2015, STAT_FILE, FALSE, "ctxt", GuestStatID_ContextSwapRate, GuestUnitsNumberPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2015, P1_2015, NULL, FALSE, NULL, GuestStatID_PhysicalPageSize, GuestUnitsBytes, GuestTypeUint64), - - DECLARE_STAT(P1_2015, P1_2016, MEMINFO_FILE, FALSE, "MemAvailable", GuestStatID_Linux_MemAvailable, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2016, MEMINFO_FILE, FALSE, "Inactive(file)", GuestStatID_Linux_MemInactiveFile, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2016, MEMINFO_FILE, FALSE, "SReclaimable", GuestStatID_Linux_MemSlabReclaim, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2016, MEMINFO_FILE, FALSE, "Buffers", GuestStatID_Linux_MemBuffers, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2016, MEMINFO_FILE, FALSE, "Cached", GuestStatID_Linux_MemCached, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P1_2016, NULL, FALSE, NULL, GuestStatID_SwapSpaceUsed, GuestUnitsKiB, GuestTypeUint64), - - DECLARE_STAT(P1_2015, P2, MEMINFO_FILE, FALSE, "MemTotal", GuestStatID_Linux_MemTotal, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P2, MEMINFO_FILE, FALSE, "SwapTotal", GuestStatID_SwapFilesCurrent, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P2, NULL, FALSE, NULL, GuestStatID_SwapFilesMax, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2015, P2, ZONEINFO_FILE, TRUE, "low", GuestStatID_Linux_LowWaterMark, GuestUnitsPages, GuestTypeUint64), - -#if PUBLISH_P1_2016_STATS - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Active(anon)", GuestStatID_Linux_MemActiveAnon, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Inactive(anon)", GuestStatID_Linux_MemInactiveAnon, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Inactive", GuestStatID_Linux_MemInactive, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Active", GuestStatID_Linux_MemActive, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Unevictable", GuestStatID_Linux_MemPinned, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, MEMINFO_FILE, FALSE, "Dirty", GuestStatID_Linux_MemDirty, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P1_2016, P1_2016, VMSTAT_FILE, FALSE, "pswpin", GuestStatID_PageSwapInRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2016, P1_2016, VMSTAT_FILE, FALSE, "pswpout", GuestStatID_PageSwapOutRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2016, P1_2016, NULL, FALSE, NULL, GuestStatID_ThreadCreationRate, GuestUnitsNumberPerSecond, GuestTypeDouble), - DECLARE_STAT(P1_2016, P1_2016, SWAPPINESS_FILE, FALSE, NULL, GuestStatID_Linux_Swappiness, GuestUnitsPercent, GuestTypeUint64), -#endif - -#if PUBLISH_P2_STATS - DECLARE_STAT(P2, P2, MEMINFO_FILE, FALSE, "SwapCached", GuestStatID_Linux_MemSwapCached, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P2, P2, MEMINFO_FILE, FALSE, "Committed_AS", GuestStatID_Linux_MemCommitted, GuestUnitsKiB, GuestTypeUint64), - DECLARE_STAT(P2, P2, MEMINFO_FILE, FALSE, "HugePages_Free", GuestStatID_Linux_HugePagesFree, GuestUnitsHugePages, GuestTypeUint64), - DECLARE_STAT(P2, P2, VMSTAT_FILE, FALSE, "pgfault", GuestStatID_Linux_PageFaultRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, VMSTAT_FILE, FALSE, "pgmajfault", GuestStatID_Linux_PageMajorFaultRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, VMSTAT_FILE, FALSE, "pgfree", GuestStatID_Linux_PageFreeRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, VMSTAT_FILE, TRUE, "pgsteal_", GuestStatID_Linux_PageStealRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, VMSTAT_FILE, TRUE, "pgscan_kswapd_", GuestStatID_Linux_PageSwapScanRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, VMSTAT_FILE, TRUE, "pgscan_direct_", GuestStatID_Linux_PageDirectScanRate, GuestUnitsPagesPerSecond, GuestTypeDouble), - DECLARE_STAT(P2, P2, STAT_FILE, FALSE, "processes", GuestStatID_ProcessCreationRate, GuestUnitsNumberPerSecond, GuestTypeDouble), -#endif + DECLARE_STAT(TRUE, TRUE, MEMINFO_FILE, FALSE, "Hugepagesize", GuestStatID_HugePageSize, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, ZONEINFO_FILE,TRUE, "present", GuestStatID_MemPhysUsable, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, MEMINFO_FILE, FALSE, "MemFree", GuestStatID_MemFree, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, MEMINFO_FILE, FALSE, "Active(file)", GuestStatID_MemActiveFileCache, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, MEMINFO_FILE, FALSE, "SwapFree", GuestStatID_SwapSpaceRemaining, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, MEMINFO_FILE, FALSE, "HugePages_Total", GuestStatID_Linux_HugePagesTotal, GuestUnitsHugePages, GuestTypeUint64), + DECLARE_STAT(TRUE, TRUE, VMSTAT_FILE, FALSE, "pgpgin", GuestStatID_PageInRate, GuestUnitsPagesPerSecond, GuestTypeDouble), + DECLARE_STAT(TRUE, TRUE, VMSTAT_FILE, FALSE, "pgpgout", GuestStatID_PageOutRate, GuestUnitsPagesPerSecond, GuestTypeDouble), + DECLARE_STAT(TRUE, TRUE, STAT_FILE, FALSE, "ctxt", GuestStatID_ContextSwapRate, GuestUnitsNumberPerSecond, GuestTypeDouble), + DECLARE_STAT(TRUE, TRUE, NULL, FALSE, NULL, GuestStatID_PhysicalPageSize, GuestUnitsBytes, GuestTypeUint64), + + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "MemAvailable", GuestStatID_Linux_MemAvailable, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "Inactive(file)", GuestStatID_Linux_MemInactiveFile, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "SReclaimable", GuestStatID_Linux_MemSlabReclaim, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "Buffers", GuestStatID_Linux_MemBuffers, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "Cached", GuestStatID_Linux_MemCached, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, NULL, FALSE, NULL, GuestStatID_SwapSpaceUsed, GuestUnitsKiB, GuestTypeUint64), + + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "MemTotal", GuestStatID_Linux_MemTotal, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, MEMINFO_FILE, FALSE, "SwapTotal", GuestStatID_SwapFilesCurrent, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, NULL, FALSE, NULL, GuestStatID_SwapFilesMax, GuestUnitsKiB, GuestTypeUint64), + DECLARE_STAT(TRUE, FALSE, ZONEINFO_FILE, TRUE, "low", GuestStatID_Linux_LowWaterMark, GuestUnitsPages, GuestTypeUint64), }; #define N_QUERIES (sizeof guestInfoQuerySpecTable / sizeof(GuestInfoQuery)) @@ -397,64 +367,6 @@ GuestInfoProcData(const char *pathName, // IN: path name } -/* - *---------------------------------------------------------------------- - * - * GuestInfoProcSimpleValue -- - * - * Reads the specified /proc file, extracts a single, simple value and - * adds it to the collection. - * - * Results: - * TRUE Success! - * FALSE Failure! - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -#if PUBLISH_P1_2016_STATS - -static Bool -GuestInfoProcSimpleValue(const char *pathName, // IN: - GuestStatToolsID reportID, // IN: - GuestInfoCollector *collector) // IN/OUT: -{ - char line[4096]; - uint64 value = 0; - FILE *fp = Posix_Fopen(pathName, "r"); - Bool success = FALSE; - - if (fp == NULL) { - g_warning("%s: Error opening %s.\n", __FUNCTION__, pathName); - return success; - } - - if (fgets(line, sizeof line, fp) != NULL) { - if (sscanf(line, "%"FMT64"u", &value) == 1) { - success = TRUE; - } - } - - fclose(fp); - - if (success) { - GuestInfoStat *stat = NULL; - - HashTable_Lookup(collector->reportMap, INT_AS_HASHKEY(reportID), - (void **) &stat); - - if (stat != NULL) { - GuestInfoStoreStat(pathName, stat, value); - } - } - - return success; -} -#endif - - /* *---------------------------------------------------------------------- * @@ -569,10 +481,6 @@ GuestInfoCollect(GuestInfoCollector *collector) // IN: GuestInfoProcData(VMSTAT_FILE, collector); GuestInfoProcData(STAT_FILE, collector); GuestInfoProcData(ZONEINFO_FILE, collector); -#if PUBLISH_P1_2016_STATS - GuestInfoProcSimpleValue(SWAPPINESS_FILE, GuestStatID_Linux_Swappiness, - collector); -#endif GuestInfoDeriveSwapData(collector); collector->timeData = GuestInfoGetUpTime(&collector->timeStamp); @@ -639,7 +547,7 @@ GuestInfoCollect(GuestInfoCollector *collector) // IN: static void GuestInfoLegacy(GuestInfoCollector *current, // IN: current collection - GuestMemInfoLegacy *legacy) // OUT: data filled out + GuestMemInfo *legacy) // OUT: data filled out { GuestInfoStat *stat; @@ -983,7 +891,6 @@ GuestInfoAppendMemNeeded(GuestInfoCollector *current, // IN: current collection memNeededReservation = 0; } -#if PUBLISH_P1_2015_STATS GuestInfoAppendStat(0, emitNameSpace, GuestStatID_MemNeeded, @@ -993,17 +900,6 @@ GuestInfoAppendMemNeeded(GuestInfoCollector *current, // IN: current collection statBuf); emitNameSpace = FALSE; -#endif - -#if PUBLISH_P2_STATS - GuestInfoAppendStat(0, - emitNameSpace, - GuestStatID_MemNeededReservation, - GuestUnitsKiB, GuestTypeUint64, - &memNeededReservation, - GuestInfoBytesNeededUIntDatum(memNeededReservation), - statBuf); -#endif } @@ -1053,7 +949,7 @@ GuestInfoEncodeStats(GuestInfoCollector *current, // IN: current collection DynBuf *statBuf) // IN/OUT: stats data { uint32 i; - GuestMemInfoLegacy legacy; + GuestMemInfo legacy; Bool emitNameSpace = TRUE; /* Provide legacy data for backwards compatibility */