- io_u->file->last_completed_pos = io_u->endpos;
-
- usec = utime_since(&io_u->issue_time, &icd->time);
-
- add_clat_sample(td, idx, usec);
- add_bw_sample(td, idx, &icd->time);
- io_u_mark_latency(td, usec);
+ if (ramp_time_over(td)) {
+ unsigned long uninitialized_var(lusec);
+ unsigned long uninitialized_var(rusec);
+
+ if (!td->o.disable_clat || !td->o.disable_bw)
+ lusec = utime_since(&io_u->issue_time,
+ &icd->time);
+ if (__should_check_rate(td, idx) ||
+ __should_check_rate(td, idx ^ 1))
+ rusec = utime_since(&io_u->start_time,
+ &icd->time);
+
+ if (!td->o.disable_clat) {
+ add_clat_sample(td, idx, usec, bytes);
+ io_u_mark_latency(td, lusec);
+ }
+ if (!td->o.disable_bw)
+ add_bw_sample(td, idx, bytes, &icd->time);
+ if (__should_check_rate(td, idx)) {
+ td->rate_pending_usleep[idx] +=
+ (long) td->rate_usec_cycle[idx] - rusec;
+ }
+ if (__should_check_rate(td, idx ^ 1))
+ td->rate_pending_usleep[idx ^ 1] -= rusec;
+ }