static struct submitter *submitter;
static volatile int finish;
+static int stats_running;
static int depth = DEPTH;
static int batch_submit = BATCH_SUBMIT;
sqe->ioprio = 0;
sqe->off = offset;
sqe->user_data = (unsigned long) f->fileno;
- if (stats)
+ if (stats && stats_running)
sqe->user_data |= ((unsigned long)s->clock_index << 32);
}
stat_nr = 0;
}
last_idx = clock_index;
- }
- stat_nr++;
+ } else if (clock_index)
+ stat_nr++;
}
reaped++;
head++;
if (stats) {
nr_batch = roundup_pow2(depth / batch_submit);
s->clock_batch = calloc(nr_batch, sizeof(unsigned long));
- s->clock_index = 0;
+ s->clock_index = 1;
s->plat = calloc(PLAT_NR, sizeof(unsigned long));
} else {
s->iovecs[index].iov_len, offset);
data = f->fileno;
- if (stats)
+ if (stats && stats_running)
data |= ((unsigned long) s->clock_index << 32);
iocb->data = (void *) (uintptr_t) data;
index++;
stat_nr = 0;
}
last_idx = clock_index;
- }
- stat_nr++;
+ } else if (clock_index)
+ stat_nr++;
}
reaped++;
evs--;
/* don't print partial run, if interrupted by signal */
if (finish)
break;
+
+ /* one second in to the run, enable stats */
+ if (stats)
+ stats_running = 1;
+
for (j = 0; j < nthreads; j++) {
this_done += s->done;
this_call += s->calls;