File sysstat-10.2.1-iostat-sar-util.patch of Package sysstat.5902
Index: sysstat-10.2.1/iostat.c
===================================================================
--- sysstat-10.2.1.orig/iostat.c
+++ sysstat-10.2.1/iostat.c
@@ -1208,15 +1208,9 @@ void rw_io_stat_loop(long int count, str
setbuf(stdout, NULL);
do {
- if (cpu_nr > 1) {
- /*
- * Read system uptime (only for SMP machines).
- * Init uptime0. So if /proc/uptime cannot fill it,
- * this will be done by /proc/stat.
- */
- uptime0[curr] = 0;
- read_uptime(&(uptime0[curr]));
- }
+ /* Read system uptime (only for SMP machines) */
+ uptime0[curr] = 0;
+ read_uptime(&(uptime0[curr]));
/*
* Read stats for CPU "all" and 0.
Index: sysstat-10.2.1/mpstat.c
===================================================================
--- sysstat-10.2.1.orig/mpstat.c
+++ sysstat-10.2.1/mpstat.c
@@ -737,15 +737,9 @@ void rw_mpstat_loop(int dis_hdr, int row
/* Dont buffer data if redirected to a pipe */
setbuf(stdout, NULL);
- /* Read stats */
- if (cpu_nr > 1) {
- /*
- * Init uptime0. So if /proc/uptime cannot fill it,
- * this will be done by /proc/stat.
- */
- uptime0[0] = 0;
- read_uptime(&(uptime0[0]));
- }
+ /* Read system uptime and CPU stats */
+ uptime0[0] = 0;
+ read_uptime(&(uptime0[0]));
read_stat_cpu(st_cpu[0], cpu_nr + 1, &(uptime[0]), &(uptime0[0]));
if (DISPLAY_IRQ_SUM(actflags)) {
@@ -818,11 +812,9 @@ void rw_mpstat_loop(int dis_hdr, int row
/* Get time */
get_localtime(&(mp_tstamp[curr]), 0);
- /* Read stats */
- if (cpu_nr > 1) {
- uptime0[curr] = 0;
- read_uptime(&(uptime0[curr]));
- }
+ /* Read uptime and CPU stats */
+ uptime0[curr] = 0;
+ read_uptime(&(uptime0[curr]));
read_stat_cpu(st_cpu[curr], cpu_nr + 1, &(uptime[curr]), &(uptime0[curr]));
if (DISPLAY_IRQ_SUM(actflags)) {
Index: sysstat-10.2.1/pidstat.c
===================================================================
--- sysstat-10.2.1.orig/pidstat.c
+++ sysstat-10.2.1/pidstat.c
@@ -2177,15 +2177,9 @@ void rw_pidstat_loop(int dis_hdr, int ro
/* Don't buffer data if redirected to a pipe */
setbuf(stdout, NULL);
- if (cpu_nr > 1) {
- /*
- * Read system uptime (only for SMP machines).
- * Init uptime0. So if /proc/uptime cannot fill it, this will be
- * done by /proc/stat.
- */
- uptime0[0] = 0;
- read_uptime(&uptime0[0]);
- }
+ /* Read system uptime */
+ uptime0[curr] = 0;
+ read_uptime(&uptime0[0]);
read_stats(0);
if (DISPLAY_MEM(actflag)) {
@@ -2229,15 +2223,9 @@ void rw_pidstat_loop(int dis_hdr, int ro
/* Get time */
get_localtime(&ps_tstamp[curr], 0);
- if (cpu_nr > 1) {
- /*
- * Read system uptime (only for SMP machines).
- * Init uptime0. So if /proc/uptime cannot fill it, this will be
- * done by /proc/stat.
- */
- uptime0[curr] = 0;
- read_uptime(&(uptime0[curr]));
- }
+ /* Read system uptime */
+ uptime0[curr] = 0;
+ read_uptime(&(uptime0[curr]));
/* Read stats */
read_stats(curr);
Index: sysstat-10.2.1/cifsiostat.c
===================================================================
--- sysstat-10.2.1.orig/cifsiostat.c
+++ sysstat-10.2.1/cifsiostat.c
@@ -523,15 +523,9 @@ void rw_io_stat_loop(long int count, str
setbuf(stdout, NULL);
do {
- if (cpu_nr > 1) {
- /*
- * Read system uptime (only for SMP machines).
- * Init uptime0. So if /proc/uptime cannot fill it,
- * this will be done by /proc/stat.
- */
- uptime0[curr] = 0;
- read_uptime(&(uptime0[curr]));
- }
+ /* Read system uptime (only for SMP machines). */
+ uptime0[curr] = 0;
+ read_uptime(&(uptime0[curr]));
/* Read CIFS stats */
read_cifs_stat(curr);
Index: sysstat-10.2.1/nfsiostat.c
===================================================================
--- sysstat-10.2.1.orig/nfsiostat.c
+++ sysstat-10.2.1/nfsiostat.c
@@ -591,15 +591,10 @@ void rw_io_stat_loop(long int count, str
setbuf(stdout, NULL);
do {
- if (cpu_nr > 1) {
- /*
- * Read system uptime (only for SMP machines).
- * Init uptime0. So if /proc/uptime cannot fill it,
- * this will be done by /proc/stat.
- */
- uptime0[curr] = 0;
- read_uptime(&(uptime0[curr]));
- }
+ /* Read system uptime (only for SMP machines). */
+ uptime0[curr] = 0;
+ read_uptime(&(uptime0[curr]));
+
/* Read NFS directories stats */
read_nfs_stat(curr);