]> granicus.if.org Git - sysstat/commitdiff
/proc/vmstat fix for Linux 4.8
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 28 Oct 2016 14:48:07 +0000 (16:48 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 28 Oct 2016 14:48:07 +0000 (16:48 +0200)
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 <sgoel01@yahoo.com>
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
rd_stats.c

index d5e9ca35b72987820a3051b45ce41eae8dc0d0fd..be72dc4b6ac368b9171b83e9de7af6e35af05b83 100644 (file)
@@ -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;