additional metrics of zoneinfo

"Wu, Liming" <[email protected]>
Newsgroups gmane.comp.sysutils.pcp
Message-ID <[email protected]>
Hi:
   
   This patch add some information from /proc/zoneinfo 
   I think those information is useful for performance analysis.
   please refer to the attachment for the details.


Thanks,

--
Liming Wu
--



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#14950): https://groups.io/g/pcp/message/14950
View All Messages In Topic (1): https://groups.io/g/pcp/topic/3858433
Mute This Topic: https://groups.io/mt/3858433?uid=174580
New Topic: https://groups.io/g/pcp/post
-=-=-
pcp mailing list
[email protected]
https://groups.io/g/pcp/messages
-=-=-
Change Your Subscription: https://groups.io/g/pcp/editsub?uid=174580
Group Home: https://groups.io/g/pcp
Contact Group Owner: [email protected]
Terms of Service: https://groups.io/static/tos
Unsubscribe: https://groups.io/g/pcp/leave/354243/563757577/xyzzy
-=-=-=-=-=-=-=-=-=-=-=-
Additional-metrics-of-proc-zoneinfo.patch (application/octet-stream, 6.1 KB)
From aec50095ee00d5376e81cb5d6c9c17148a9a4818 Mon Sep 17 00:00:00 2001
From: Liming <[email protected]>
Date: Thu, 29 Dec 2016 13:32:06 +0800
Subject: [PATCH] Additional metrics of /proc/zoneinfo

add some useful infomation that read from /proc/zoneinfo.
---
 src/pmdas/linux/help            |  8 ++++++++
 src/pmdas/linux/pmda.c          | 40 ++++++++++++++++++++++++++++++++++++++++
 src/pmdas/linux/proc_zoneinfo.c | 40 ++++++++++++++++++++++++++++++++++++++++
 src/pmdas/linux/proc_zoneinfo.h | 10 +++++++++-
 src/pmdas/linux/root_linux      |  8 ++++++++
 5 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/src/pmdas/linux/help b/src/pmdas/linux/help
index 5d48c9b..1b0f303 100644
--- a/src/pmdas/linux/help
+++ b/src/pmdas/linux/help
@@ -924,6 +924,14 @@ Count of huge TLB page buddy allocation successes, from /proc/vmstat
 @ mem.vmstat.balloon_deflate number of virt guest balloon page deflations
 @ mem.vmstat.balloon_migrate number of virt guest balloon page migrations
 @ mem.zoneinfo.free free space in each zone for each NUMA node
+@ mem.zoneinfo.min  min space in each zone for each NUMA node
+@ mem.zoneinfo.low  low space in each zone for each NUMA node
+@ mem.zoneinfo.high high space in each zone for each NUMA node
+@ mem.zoneinfo.scanned scanned space in each zone for each NUMA node
+@ mem.zoneinfo.spanned spanned space in each zone for each NUMA node
+@ mem.zoneinfo.present present space in each zone for each NUMA node
+@ mem.zoneinfo.managed managed space in each zone for each NUMA node
+@ mem.zoneinfo.protection protection space in each zone for each NUMA node
 
 @ swap.length total swap available metric from /proc/meminfo
 @ swap.used swap used metric from /proc/meminfo
diff --git a/src/pmdas/linux/pmda.c b/src/pmdas/linux/pmda.c
index a0b5855..babd0ef 100644
--- a/src/pmdas/linux/pmda.c
+++ b/src/pmdas/linux/pmda.c
@@ -3549,6 +3549,46 @@ static pmdaMetric metrictab[] = {
     { PMDA_PMID(CLUSTER_ZONEINFO,0), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
       PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
 
+/* mem.zoneinfo.min */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,1), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.low */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,2), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.high */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,3), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.scanned */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,4), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.spanned */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,5), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.present */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,6), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.managed */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,7), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
+/* mem.zoneinfo.protection */
+  { NULL,
+    { PMDA_PMID(CLUSTER_ZONEINFO,8), PM_TYPE_U64, ZONEINFO_INDOM, PM_SEM_INSTANT,
+      PMDA_PMUNITS(1,0,0,PM_SPACE_KBYTE,0,0) }, },
+
 /*
  * /proc/cpuinfo cluster (cpu indom)
  */
diff --git a/src/pmdas/linux/proc_zoneinfo.c b/src/pmdas/linux/proc_zoneinfo.c
index cabade7..e8bd2e1 100644
--- a/src/pmdas/linux/proc_zoneinfo.c
+++ b/src/pmdas/linux/proc_zoneinfo.c
@@ -60,6 +60,46 @@ refresh_proc_zoneinfo(pmInDom indom)
 		values++;
 		continue;
 	    }
+	    else if ((sscanf(buf, "        min %llu", &value)) == 1) {
+		info->values[ZONE_MIN] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        low %llu", &value)) == 1) {
+		info->values[ZONE_LOW] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        high %llu", &value)) == 1) {
+		info->values[ZONE_HIGH] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        scanned %llu", &value)) == 1) {
+		info->values[ZONE_SCANNED] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        spanned %llu", &value)) == 1) {
+		info->values[ZONE_SPANNED] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        present %llu", &value)) == 1) {
+		info->values[ZONE_PRESENT] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        managed %llu", &value)) == 1) {
+		info->values[ZONE_MANAGED] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
+	    else if ((sscanf(buf, "        protection: (%*d, %*d, %*d, %d)", &value)) == 1) {
+		info->values[ZONE_PROTECTION] = (value << _pm_pageshift) / 1024;
+		values++;
+		continue;
+	    }
 	}
 	pmdaCacheStore(indom, PMDA_CACHE_ADD, instname, (void *)info);
 
diff --git a/src/pmdas/linux/proc_zoneinfo.h b/src/pmdas/linux/proc_zoneinfo.h
index aff57fd..e4288a9 100644
--- a/src/pmdas/linux/proc_zoneinfo.h
+++ b/src/pmdas/linux/proc_zoneinfo.h
@@ -16,7 +16,15 @@
  */
 
 enum {
-    ZONE_FREE	= 0,
+    ZONE_FREE          = 0,
+    ZONE_MIN           = 1,
+    ZONE_LOW           = 2,
+    ZONE_HIGH          = 3,
+    ZONE_SCANNED       = 4,
+    ZONE_SPANNED       = 5,
+    ZONE_PRESENT       = 6,
+    ZONE_MANAGED       = 7,
+    ZONE_PROTECTION    = 8,
     /* enumerate all values here */
     ZONE_VALUES	/* maximum value */
 };
diff --git a/src/pmdas/linux/root_linux b/src/pmdas/linux/root_linux
index 31df0cb..dd7d75e 100644
--- a/src/pmdas/linux/root_linux
+++ b/src/pmdas/linux/root_linux
@@ -493,6 +493,14 @@ mem.numa.alloc {
 
 mem.zoneinfo {
     free		60:68:0
+    min 		60:68:1
+    low   		60:68:2
+    high		60:68:3
+    scanned		60:68:4
+    spanned		60:68:5
+    present		60:68:6
+    managed		60:68:7
+    protection  	60:68:8
 }
 
 swap {
-- 
1.8.3.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.