{
uint64_t usec = utime_since_now(&td->last_issue);
unsigned long orig_delay = delay;
- uint64_t this_delay;
struct timespec ts;
+ int ret = 0;
if (delay < td->time_offset) {
td->time_offset = 0;
delay -= usec;
fio_gettime(&ts, NULL);
- while (delay && !td->terminate) {
- this_delay = delay;
- if (this_delay > 500000)
- this_delay = 500000;
- usec_sleep(td, this_delay);
- delay -= this_delay;
+ while (delay && !td->terminate) {
+ ret = io_u_queued_complete(td, 0);
+ if (ret < 0)
+ td_verror(td, -ret, "io_u_queued_complete");
+ if (utime_since_now(&ts) > delay)
+ break;
}
usec = utime_since_now(&ts);
if (log_offset) {
if (log_prio)
- fmt = "%lu, %" PRId64 ", %u, %llu, %llu, 0x%04x\n";
+ fmt = "%" PRIu64 ", %" PRId64 ", %u, %llu, %llu, 0x%04x\n";
else
- fmt = "%lu, %" PRId64 ", %u, %llu, %llu, %u\n";
+ fmt = "%" PRIu64 ", %" PRId64 ", %u, %llu, %llu, %u\n";
} else {
if (log_prio)
- fmt = "%lu, %" PRId64 ", %u, %llu, 0x%04x\n";
+ fmt = "%" PRIu64 ", %" PRId64 ", %u, %llu, 0x%04x\n";
else
- fmt = "%lu, %" PRId64 ", %u, %llu, %u\n";
+ fmt = "%" PRIu64 ", %" PRId64 ", %u, %llu, %u\n";
}
nr_samples = sample_size / __log_entry_sz(log_offset);
if (!log_offset) {
fprintf(f, fmt,
- (unsigned long) s->time,
+ s->time,
s->data.val,
io_sample_ddir(s), (unsigned long long) s->bs,
prio_val);
struct io_sample_offset *so = (void *) s;
fprintf(f, fmt,
- (unsigned long) s->time,
+ s->time,
s->data.val,
io_sample_ddir(s), (unsigned long long) s->bs,
(unsigned long long) so->offset,
void fio_writeout_logs(bool unit_logs)
{
- struct thread_data *td;
- int i;
-
- for_each_td(td, i)
+ for_each_td(td) {
td_writeout_logs(td, unit_logs);
+ } end_for_each();
}