void init_disk_util(struct thread_data *td)
{
+ struct fio_file *f;
struct stat st;
char foo[256], tmp[256];
dev_t dev;
if (!td->do_disk_util)
return;
- if (!stat(td->file_name, &st)) {
+ /*
+ * Just use the same file, they are on the same device.
+ */
+ f = &td->files[0];
+ if (!stat(f->file_name, &st)) {
if (S_ISBLK(st.st_mode))
dev = st.st_rdev;
else
/*
* must be a file, open "." in that path
*/
- strcpy(foo, td->file_name);
+ strcpy(foo, f->file_name);
p = dirname(foo);
if (stat(p, &st)) {
perror("disk util stat");
log_err("unknown sysfs layout\n");
return;
}
- sprintf(foo, "%s", p);
+ strcpy(tmp, p);
+ sprintf(foo, "%s", tmp);
}
td->sysfs_root = strdup(foo);
rs->min_bw[1] = rs->min_run[1] = ~0UL;
}
- for (i = 0; i < thread_number; i++) {
+ for_each_td(td, i) {
unsigned long long rbw, wbw;
- td = &threads[i];
-
if (td->error) {
fprintf(f_out, "%s: %s\n", td->name, td->verror);
continue;
if (!terse_output)
printf("\n");
- for (i = 0; i < thread_number; i++) {
- td = &threads[i];
+ for_each_td(td, i) {
rs = &runstats[td->groupid];
if (terse_output)