Blame SOURCES/sysstat-10.1.5-single-cpu-cifs.patch

c288c9
diff -upr sysstat-10.1.5.orig/cifsiostat.c sysstat-10.1.5/cifsiostat.c
c288c9
--- sysstat-10.1.5.orig/cifsiostat.c	2013-03-23 17:31:46.000000000 +0100
c288c9
+++ sysstat-10.1.5/cifsiostat.c	2014-09-29 14:23:37.600574444 +0200
c288c9
@@ -43,7 +43,6 @@
c288c9
 #define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
c288c9
 char *sccsid(void) { return (SCCSID); }
c288c9
 
c288c9
-unsigned long long uptime[2]  = {0, 0};
c288c9
 unsigned long long uptime0[2] = {0, 0};
c288c9
 struct cifs_stats *st_cifs[2];
c288c9
 struct io_hdr_stats *st_hdr_cifs;
c288c9
@@ -474,13 +473,8 @@ void write_stats(int curr, struct tm *re
c288c9
 #endif
c288c9
 	}
c288c9
 
c288c9
-	/* Interval is multiplied by the number of processors */
c288c9
-	itv = get_interval(uptime[!curr], uptime[curr]);
c288c9
-
c288c9
-	if (cpu_nr > 1) {
c288c9
-		/* On SMP machines, reduce itv to one processor (see note above) */
c288c9
-		itv = get_interval(uptime0[!curr], uptime0[curr]);
c288c9
-	}
c288c9
+	/* Interval of time, reduced to one processor */
c288c9
+	itv = get_interval(uptime0[!curr], uptime0[curr]);
c288c9
 
c288c9
 	shi = st_hdr_cifs;
c288c9
 
c288c9
@@ -527,15 +521,12 @@ void rw_io_stat_loop(long int count, str
c288c9
 	setbuf(stdout, NULL);
c288c9
 	
c288c9
 	do {
c288c9
-		if (cpu_nr > 1) {
c288c9
-			/*
c288c9
-			 * Read system uptime (only for SMP machines).
c288c9
-			 * Init uptime0. So if /proc/uptime cannot fill it,
c288c9
-			 * this will be done by /proc/stat.
c288c9
-			 */
c288c9
-			uptime0[curr] = 0;
c288c9
-			read_uptime(&(uptime0[curr]));
c288c9
-		}
c288c9
+		/* Read system uptime (reduced to one processor) */
c288c9
+		uptime0[curr] = 0;
c288c9
+		read_uptime(&(uptime0[curr]));
c288c9
+		if (!uptime0[curr])
c288c9
+			/* Cannot read system uptime (/proc/uptime doesn't exist) */
c288c9
+			exit(2);
c288c9
 
c288c9
 		/* Read CIFS stats */
c288c9
 		read_cifs_stat(curr);
c288c9
diff -upr sysstat-10.1.5.orig/nfsiostat.c sysstat-10.1.5/nfsiostat.c
c288c9
--- sysstat-10.1.5.orig/nfsiostat.c	2013-03-23 17:31:46.000000000 +0100
c288c9
+++ sysstat-10.1.5/nfsiostat.c	2014-09-29 14:23:37.601574440 +0200
c288c9
@@ -42,7 +42,6 @@
c288c9
 #define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
c288c9
 char *sccsid(void) { return (SCCSID); }
c288c9
 
c288c9
-unsigned long long uptime[2]  = {0, 0};
c288c9
 unsigned long long uptime0[2] = {0, 0};
c288c9
 struct io_nfs_stats *st_ionfs[2];
c288c9
 struct io_hdr_stats *st_hdr_ionfs;
c288c9
@@ -541,13 +540,8 @@ void write_stats(int curr, struct tm *re
c288c9
 #endif
c288c9
 	}
c288c9
 
c288c9
-	/* Interval is multiplied by the number of processors */
c288c9
-	itv = get_interval(uptime[!curr], uptime[curr]);
c288c9
-
c288c9
-	if (cpu_nr > 1) {
c288c9
-		/* On SMP machines, reduce itv to one processor (see note above) */
c288c9
-		itv = get_interval(uptime0[!curr], uptime0[curr]);
c288c9
-	}
c288c9
+	/* Interval of time, reduced to one processor */
c288c9
+	itv = get_interval(uptime0[!curr], uptime0[curr]);
c288c9
 
c288c9
 	shi = st_hdr_ionfs;
c288c9
 
c288c9
@@ -595,15 +589,13 @@ void rw_io_stat_loop(long int count, str
c288c9
 	setbuf(stdout, NULL);
c288c9
 	
c288c9
 	do {
c288c9
-		if (cpu_nr > 1) {
c288c9
-			/*
c288c9
-			 * Read system uptime (only for SMP machines).
c288c9
-			 * Init uptime0. So if /proc/uptime cannot fill it,
c288c9
-			 * this will be done by /proc/stat.
c288c9
-			 */
c288c9
-			uptime0[curr] = 0;
c288c9
-			read_uptime(&(uptime0[curr]));
c288c9
-		}
c288c9
+		/* Read system uptime (reduced to one processor) */
c288c9
+		uptime0[curr] = 0;
c288c9
+		read_uptime(&(uptime0[curr]));
c288c9
+		if (!uptime0[curr])
c288c9
+			/* Cannot read system uptime (/proc/uptime doesn't exist) */
c288c9
+			exit(2);
c288c9
+
c288c9
 		/* Read NFS directories stats */
c288c9
 		read_nfs_stat(curr);
c288c9