From 809327383c6f30cdb446b3cc395817dc71b3aa77 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Fri, 28 Oct 2016 16:48:07 +0200 Subject: [PATCH] /proc/vmstat fix for Linux 4.8 The 4.8 kernel has some changes in /proc/vmstat which cause sysstat to report zero values for {pgscank,pgscand}/s in sar -B. The attached patch fixes this for 4.8 while retaining compatibility with older kernels. Signed-off-by: Shantanu Goel Signed-off-by: Sebastien GODARD --- rd_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rd_stats.c b/rd_stats.c index d5e9ca3..be72dc4 100644 --- a/rd_stats.c +++ b/rd_stats.c @@ -541,12 +541,12 @@ void read_vmstat_paging(struct stats_paging *st_paging) sscanf(strchr(line, ' '), "%lu", &pgtmp); st_paging->pgsteal += pgtmp; } - else if (!strncmp(line, "pgscan_kswapd_", 14)) { + else if (!strncmp(line, "pgscan_kswapd", 13)) { /* Read number of pages scanned by the kswapd daemon */ sscanf(strchr(line, ' '), "%lu", &pgtmp); st_paging->pgscan_kswapd += pgtmp; } - else if (!strncmp(line, "pgscan_direct_", 14)) { + else if (!strncmp(line, "pgscan_direct", 13)) { /* Read number of pages scanned directly */ sscanf(strchr(line, ' '), "%lu", &pgtmp); st_paging->pgscan_direct += pgtmp; -- 2.40.0