projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add debug trace for io_u_queue_complete()
[fio.git]
/
log.c
diff --git
a/log.c
b/log.c
index 759771ae6a5d3167b7fcb36f92990164d3faf351..5b21ee224d2b7a24131563581e5ff4e019f7c118 100644
(file)
--- a/
log.c
+++ b/
log.c
@@
-84,6
+84,9
@@
int read_iolog_get(struct thread_data *td, struct io_u *io_u)
io_u->file = &td->files[ipo->fileno];
get_file(io_u->file);
io_u->file = &td->files[ipo->fileno];
get_file(io_u->file);
+ dprint(FD_IO, "iolog: get %llu/%lu/%s\n", io_u->offset,
+ io_u->buflen, io_u->file->file_name);
+
if (ipo->delay)
iolog_delay(td, ipo->delay);
if (ipo->delay)
iolog_delay(td, ipo->delay);
@@
-233,9
+236,14
@@
static int read_iolog2(struct thread_data *td, FILE *f)
if (rw == DDIR_READ)
reads++;
if (rw == DDIR_READ)
reads++;
- else if (rw == DDIR_WRITE)
+ else if (rw == DDIR_WRITE)
{
writes++;
writes++;
- else if (rw != DDIR_SYNC && rw != DDIR_INVAL) {
+ /*
+ * Don't add a write for ro mode
+ */
+ if (read_only)
+ continue;
+ } else if (rw != DDIR_SYNC && rw != DDIR_INVAL) {
log_err("bad ddir: %d\n", rw);
continue;
}
log_err("bad ddir: %d\n", rw);
continue;
}
@@
-263,6
+271,11
@@
static int read_iolog2(struct thread_data *td, FILE *f)
free(act);
free(fname);
free(act);
free(fname);
+ if (writes && read_only) {
+ log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+ writes = 0;
+ }
+
if (!reads && !writes)
return 1;
else if (reads && !writes)
if (!reads && !writes)
return 1;
else if (reads && !writes)
@@
-284,7
+297,7
@@
static int read_iolog(struct thread_data *td, FILE *f)
unsigned int bytes;
char *str, *p;
int reads, writes;
unsigned int bytes;
char *str, *p;
int reads, writes;
-
enum fio_ddir
rw;
+
int
rw;
/*
* Read in the read iolog and store it, reuse the infrastructure
/*
* Read in the read iolog and store it, reuse the infrastructure
@@
-301,9
+314,14
@@
static int read_iolog(struct thread_data *td, FILE *f)
}
if (rw == DDIR_READ)
reads++;
}
if (rw == DDIR_READ)
reads++;
- else if (rw == DDIR_WRITE)
+ else if (rw == DDIR_WRITE)
{
writes++;
writes++;
- else if (rw != DDIR_SYNC) {
+ /*
+ * Don't add a write for ro mode
+ */
+ if (read_only)
+ continue;
+ } else if (rw != DDIR_SYNC) {
log_err("bad ddir: %d\n", rw);
continue;
}
log_err("bad ddir: %d\n", rw);
continue;
}
@@
-313,7
+331,7
@@
static int read_iolog(struct thread_data *td, FILE *f)
INIT_LIST_HEAD(&ipo->list);
ipo->offset = offset;
ipo->len = bytes;
INIT_LIST_HEAD(&ipo->list);
ipo->offset = offset;
ipo->len = bytes;
- ipo->ddir = rw;
+ ipo->ddir =
(enum fio_ddir)
rw;
if (bytes > td->o.max_bs[rw])
td->o.max_bs[rw] = bytes;
list_add_tail(&ipo->list, &td->io_log_list);
if (bytes > td->o.max_bs[rw])
td->o.max_bs[rw] = bytes;
list_add_tail(&ipo->list, &td->io_log_list);
@@
-322,6
+340,11
@@
static int read_iolog(struct thread_data *td, FILE *f)
free(str);
free(str);
+ if (writes && read_only) {
+ log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+ writes = 0;
+ }
+
if (!reads && !writes)
return 1;
else if (reads && !writes)
if (!reads && !writes)
return 1;
else if (reads && !writes)