if (no_reduce && per_unit_log(td->iops_log))
add_iops_sample(td, io_u, bytes);
- }
+ } else if (ddir_sync(idx) && !td->o.disable_clat)
+ add_sync_clat_sample(&td->ts, llnsec);
if (td->ts.nr_block_infos && io_u->ddir == DDIR_TRIM) {
uint32_t *info = io_u_block_info(td, io_u);
f->last_write_idx = 0;
}
+static bool should_account(struct thread_data *td)
+{
+ return ramp_time_over(td) && (td->runstate == TD_RUNNING ||
+ td->runstate == TD_VERIFYING);
+}
+
static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
struct io_completion_data *icd)
{
}
if (ddir_sync(ddir)) {
- td->last_was_sync = 1;
+ td->last_was_sync = true;
if (f) {
f->first_write = -1ULL;
f->last_write = -1ULL;
}
+ if (should_account(td))
+ account_io_completion(td, io_u, icd, ddir, io_u->buflen);
return;
}
- td->last_was_sync = 0;
+ td->last_was_sync = false;
td->last_ddir = ddir;
if (!io_u->error && ddir_rw(ddir)) {
if (ddir == DDIR_WRITE)
file_log_write_comp(td, f, io_u->offset, bytes);
- if (ramp_time_over(td) && (td->runstate == TD_RUNNING ||
- td->runstate == TD_VERIFYING))
+ if (should_account(td))
account_io_completion(td, io_u, icd, ddir, bytes);
icd->bytes_done[ddir] += bytes;