X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=blktrace.c;h=4b5567effe6ab2624079df36284df4ad524d0f19;hp=9e4e5998a73246cfa9a1df5e2adb2926777c056b;hb=8e25577988d7454ef2fd9c030354b70adca3c57b;hpb=f01b34ae759afccf39c1bf47972e45d91448e7bb diff --git a/blktrace.c b/blktrace.c index 9e4e5998..4b5567ef 100644 --- a/blktrace.c +++ b/blktrace.c @@ -217,6 +217,8 @@ static int trace_add_file(struct thread_data *td, __u32 device) dprint(FD_BLKTRACE, "add devices %s\n", dev); fileno = add_file_exclusive(td, dev); + td->files[fileno]->major = maj; + td->files[fileno]->minor = min; trace_add_open_close_event(td, fileno, FIO_LOG_OPEN_FILE); last_fileno = fileno; } @@ -369,7 +371,7 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap) unsigned int cpu; unsigned int rw_bs[2]; struct fifo *fifo; - int fd, i; + int fd, i, old_state; struct fio_file *f; fd = open(filename, O_RDONLY); @@ -380,6 +382,8 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap) fifo = fifo_alloc(TRACE_FIFO_SIZE); + old_state = td_bump_runstate(td, TD_SETTING_UP); + td->o.size = 0; cpu = 0; @@ -458,6 +462,8 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap) fifo_free(fifo); close(fd); + td_restore_runstate(td, old_state); + if (!td->files_index) { log_err("fio: did not find replay device(s)\n"); return 1;