Caused fio to stall waiting for disk updates.
Also add --debug=diskutil debug option, to trace what diskutil is doing.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
all Enable all debug options
random Dump info related to random offset generation
parse Dump info related to option matching and parsing
+ diskutil Dump info related to disk utilization updates
? or help Show available debug options.
You can specify as many as you want, eg --debug=file,mem will enable
list_add_tail(&ipo->list, &td->io_log_list);
}
-/*
- * We only care for queue traces, most of the others are side effects
- * due to internal workings of the block layer.
- */
-static void handle_trace(struct thread_data *td, struct blk_io_trace *t,
- unsigned long long ttime, unsigned long *ios,
- unsigned int *bs)
+static void handle_trace_notify(struct thread_data *td, struct blk_io_trace *t)
{
- int rw;
+ printf("got notify: %x, %d\n", t->action, t->pid);
+}
- if ((t->action & 0xffff) != __BLK_TA_QUEUE)
- return;
- if (t->action & BLK_TC_ACT(BLK_TC_PC))
- return;
- if (t->action & BLK_TC_ACT(BLK_TC_NOTIFY))
- return;
+static void handle_trace_fs(struct thread_data *td, struct blk_io_trace *t,
+ unsigned long long ttime, unsigned long *ios,
+ unsigned int *bs)
+{
+ int rw;
trace_add_file(td, t->device);
store_ipo(td, t->sector, t->bytes, rw, ttime);
}
+/*
+ * We only care for queue traces, most of the others are side effects
+ * due to internal workings of the block layer.
+ */
+static void handle_trace(struct thread_data *td, struct blk_io_trace *t,
+ unsigned long long ttime, unsigned long *ios,
+ unsigned int *bs)
+{
+ if ((t->action & 0xffff) != __BLK_TA_QUEUE)
+ return;
+ if (t->action & BLK_TC_ACT(BLK_TC_PC))
+ return;
+
+ if (t->action & BLK_TC_ACT(BLK_TC_NOTIFY))
+ handle_trace_notify(td, t);
+ else
+ handle_trace_fs(td, t, ttime, ios, bs);
+}
+
/*
* Load a blktrace file by reading all the blk_io_trace entries, and storing
* them as io_pieces like the fio text version would do.
FD_VERIFY,
FD_RANDOM,
FD_PARSE,
+ FD_DISKUTIL,
FD_DEBUG_MAX,
};
char *p;
int ret;
+ dprint(FD_DISKUTIL, "open stat file: %s\n", du->path);
+
f = fopen(du->path, "r");
if (!f)
return 1;
return 1;
}
- ret = scanf(p, "%u %u %llu %u %u %u %llu %u %u %u %u\n", &dus->ios[0],
+ dprint(FD_DISKUTIL, "%s: %s", du->path, p);
+
+ ret = sscanf(p, "%u %u %llu %u %u %u %llu %u %u %u %u\n", &dus->ios[0],
&dus->merges[0], &dus->sectors[0],
&dus->ticks[0], &dus->ios[1],
&dus->merges[1], &dus->sectors[1],
&dus->ticks[1], &in_flight,
&dus->io_ticks, &dus->time_in_queue);
- if (ret != 11) {
- fclose(f);
- return 1;
- }
-
fclose(f);
- return 0;
+ dprint(FD_DISKUTIL, "%s: stat read ok? %d\n", du->path, ret == 1);
+ return ret != 11;
}
static void update_io_tick_disk(struct disk_util *du)
struct list_head *entry;
struct disk_util *du;
+ dprint(FD_DISKUTIL, "update io ticks\n");
+
list_for_each(entry, &disk_list) {
du = list_entry(entry, struct disk_util, list);
update_io_tick_disk(du);
struct disk_util *du, *__du;
struct list_head *entry;
+ dprint(FD_DISKUTIL, "add maj/min %d/%d: %s\n", majdev, mindev, path);
+
du = malloc(sizeof(*du));
memset(du, 0, sizeof(*du));
INIT_LIST_HEAD(&du->list);
list_for_each(entry, &disk_list) {
__du = list_entry(entry, struct disk_util, list);
+ dprint(FD_DISKUTIL, "found %s in list\n", __du->name);
+
if (!strcmp(du->name, __du->name)) {
free(du->name);
free(du);
}
}
+ dprint(FD_DISKUTIL, "add %s to list\n", du->name);
+
fio_gettime(&du->time, NULL);
get_io_ticks(du, &du->last_dus);
mindev = minor(st.st_dev);
}
+ dprint(FD_DISKUTIL, "%s belongs to maj/min %d/%d\n", f->file_name,
+ majdev, mindev);
+
du = disk_util_exists(majdev, mindev);
if (du) {
if (td->o.ioscheduler && !td->sysfs_root)
{ .name = "verify", .shift = FD_VERIFY },
{ .name = "random", .shift = FD_RANDOM },
{ .name = "parse", .shift = FD_PARSE },
+ { .name = "diskutil", .shift = FD_DISKUTIL },
{ },
};