projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fio: HOWTO update
[fio.git]
/
log.c
diff --git
a/log.c
b/log.c
index ba5d75bf2a54701b2435a5992e468849512490b3..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);
@@
-91,6
+94,7
@@
int read_iolog_get(struct thread_data *td, struct io_u *io_u)
return 0;
}
return 0;
}
+ td->done = 1;
return 1;
}
return 1;
}
@@
-232,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;
}
@@
-255,12
+264,18
@@
static int read_iolog2(struct thread_data *td, FILE *f)
ipo->file_action = file_action;
}
list_add_tail(&ipo->list, &td->io_log_list);
ipo->file_action = file_action;
}
list_add_tail(&ipo->list, &td->io_log_list);
+ td->total_io_size += bytes;
}
free(str);
free(act);
free(fname);
}
free(str);
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)
@@
-281,7
+296,8
@@
static int read_iolog(struct thread_data *td, FILE *f)
unsigned long long offset;
unsigned int bytes;
char *str, *p;
unsigned long long offset;
unsigned int bytes;
char *str, *p;
- int rw, reads, writes;
+ int reads, writes;
+ int rw;
/*
* Read in the read iolog and store it, reuse the infrastructure
/*
* Read in the read iolog and store it, reuse the infrastructure
@@
-298,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;
}
@@
-314,10
+335,16
@@
static int read_iolog(struct thread_data *td, FILE *f)
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);
+ td->total_io_size += bytes;
}
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)