is_power_of_2() should return bool
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index f1d468c783b558ec2acef34f87d41ba748824518..fde7af299de449d3f63afec10a548d8984ddc14c 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1582,6 +1582,8 @@ void __show_run_stats(void)
                }
                if (last_ts == td->groupid)
                        continue;
+               if (!td->o.stats)
+                       continue;
 
                last_ts = td->groupid;
                nr_ts++;
@@ -1599,6 +1601,8 @@ void __show_run_stats(void)
        last_ts = -1;
        idx = 0;
        for_each_td(td, i) {
+               if (!td->o.stats)
+                       continue;
                if (idx && (!td->o.group_reporting ||
                    (td->o.group_reporting && last_ts != td->groupid))) {
                        idx = 0;
@@ -2442,7 +2446,7 @@ static int add_bw_samples(struct thread_data *td, struct timeval *t)
        /*
         * Compute both read and write rates for the interval.
         */
-       for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) {
+       for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
                uint64_t delta;
 
                delta = td->this_io_bytes[ddir] - td->stat_io_bytes[ddir];
@@ -2517,7 +2521,7 @@ static int add_iops_samples(struct thread_data *td, struct timeval *t)
        /*
         * Compute both read and write rates for the interval.
         */
-       for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) {
+       for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
                uint64_t delta;
 
                delta = td->this_io_blocks[ddir] - td->stat_io_blocks[ddir];
@@ -2569,6 +2573,8 @@ int calc_log_samples(void)
        fio_gettime(&now, NULL);
 
        for_each_td(td, i) {
+               if (!td->o.stats)
+                       continue;
                if (in_ramp_time(td) ||
                    !(td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING)) {
                        next = min(td->o.iops_avg_time, td->o.bw_avg_time);