static void steadystate_alloc(struct thread_data *td)
{
- int i;
-
- td->ss.bw_data = malloc(td->ss.dur * sizeof(uint64_t));
- td->ss.iops_data = malloc(td->ss.dur * sizeof(uint64_t));
- /* initialize so that it is obvious if the cache is not full in the output */
- for (i = 0; i < td->ss.dur; i++)
- td->ss.iops_data[i] = td->ss.bw_data[i] = 0;
+ td->ss.bw_data = calloc(td->ss.dur, sizeof(uint64_t));
+ td->ss.iops_data = calloc(td->ss.dur, sizeof(uint64_t));
td->ss.state |= __FIO_SS_DATA;
}
}
td_io_u_lock(td);
- for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) {
+ for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
td_iops += td->io_blocks[ddir];
td_bytes += td->io_bytes[ddir];
}