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

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