bytes_total = td->fill_device_size;
}
+ if (td->o.zone_size && td->o.zone_skip && bytes_total) {
+ unsigned int nr_zones;
+ uint64_t zone_bytes;
+
+ zone_bytes = bytes_total + td->o.zone_size + td->o.zone_skip;
+ nr_zones = (zone_bytes - 1) / (td->o.zone_size + td->o.zone_skip);
+ bytes_total -= nr_zones * td->o.zone_skip;
+ }
+
/*
* if writing and verifying afterwards, bytes_total will be twice the
* size. In a mixed workload, verify phase will be the size of the
bytes_total <<= 1;
}
- if (td->o.zone_size && td->o.zone_skip)
- bytes_total /= (td->o.zone_skip / td->o.zone_size);
-
if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING) {
double perc, perc_t;
je->nr_threads = thread_number;
memcpy(je->run_str, run_str, thread_number * sizeof(char));
-
return 1;
}
void display_thread_status(struct jobs_eta *je)
{
+ static struct timeval disp_eta_new_line;
+ static int eta_new_line_init, eta_new_line_pending;
static int linelen_last;
static int eta_good;
char output[REAL_MAX_JOBS + 512], *p = output;
eta_to_str(eta_str, je->eta_sec);
}
+ if (eta_new_line_pending) {
+ eta_new_line_pending = 0;
+ p += sprintf(p, "\n");
+ }
+
p += sprintf(p, "Jobs: %d (f=%d)", je->nr_running, je->files_open);
if (je->m_rate || je->t_rate) {
char *tr, *mr;
p += sprintf(p, "\r");
printf("%s", output);
+
+ if (!eta_new_line_init) {
+ fio_gettime(&disp_eta_new_line, NULL);
+ eta_new_line_init = 1;
+ } else if (eta_new_line &&
+ mtime_since_now(&disp_eta_new_line) > eta_new_line * 1000) {
+ fio_gettime(&disp_eta_new_line, NULL);
+ eta_new_line_pending = 1;
+ }
+
fflush(stdout);
}