From: tiozhang Date: Wed, 1 Mar 2023 06:19:15 +0000 (+0800) Subject: vmem: add metrics start with "pgscan_" in Kernel Linux X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8069c10a05d93b6aae0e52b1c6a14e54350fe6f;p=thirdparty%2Fcollectd.git vmem: add metrics start with "pgscan_" in Kernel Linux Some Linux Kernel versions have metrics start with "pgscan_" in /proc/vmstat, for instance: ``` cat /proc/vmstat | grep pgscan pgscan_kswapd 0 pgscan_direct 0 pgscan_direct_throttle 0 ``` Signed-off-by: tiozhang Signed-off-by: luffysong Co-authored-by: luffysong --- diff --git a/src/vmem.c b/src/vmem.c index a4112bbba..64b78dda4 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -211,6 +211,10 @@ static int vmem_read(void) { char *inst = key + strlen("pgsteal_"); value_t value = {.derive = counter}; submit_one(inst, "vmpage_action", "steal", value); + } else if (strncmp("pgscan_", key, strlen("pgscan_")) == 0) { + char *inst = key + strlen("pgscan_"); + value_t value = {.derive = counter}; + submit_one(inst, "vmpage_action", "scan", value); } else if (strncmp("pgscan_kswapd_", key, strlen("pgscan_kswapd_")) == 0) { char *inst = key + strlen("pgscan_kswapd_"); value_t value = {.derive = counter};