projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for storing compressed logs
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 77557dfdca12748f1db2249c05efc93a21b09f4b..5b9d483dcd330b69ff0ddff4f86cb9512247cf31 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-104,7
+104,7
@@
static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
- *b =
(lastb - 1)
* (r / ((uint64_t) rmax + 1.0));
+ *b =
lastb
* (r / ((uint64_t) rmax + 1.0));
} else {
uint64_t off = 0;
} else {
uint64_t off = 0;
@@
-273,7
+273,7
@@
static int get_next_seq_offset(struct thread_data *td, struct fio_file *f,
{
assert(ddir_rw(ddir));
{
assert(ddir_rw(ddir));
- if (f->last_pos >= f->io_size + get_start_offset(td) && td->o.time_based)
+ if (f->last_pos >= f->io_size + get_start_offset(td
, f
) && td->o.time_based)
f->last_pos = f->last_pos - f->io_size;
if (f->last_pos < f->real_file_size) {
f->last_pos = f->last_pos - f->io_size;
if (f->last_pos < f->real_file_size) {
@@
-415,7
+415,7
@@
static inline int io_u_fits(struct thread_data *td, struct io_u *io_u,
{
struct fio_file *f = io_u->file;
{
struct fio_file *f = io_u->file;
- return io_u->offset + buflen <= f->io_size + get_start_offset(td);
+ return io_u->offset + buflen <= f->io_size + get_start_offset(td
, f
);
}
static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
}
static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
@@
-426,12
+426,10
@@
static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
unsigned int minbs, maxbs;
unsigned long r, rand_max;
unsigned int minbs, maxbs;
unsigned long r, rand_max;
- assert(ddir_rw(
io_u->
ddir));
+ assert(ddir_rw(ddir));
if (td->o.bs_is_seq_rand)
ddir = is_random ? DDIR_WRITE: DDIR_READ;
if (td->o.bs_is_seq_rand)
ddir = is_random ? DDIR_WRITE: DDIR_READ;
- else
- ddir = io_u->ddir;
minbs = td->o.min_bs[ddir];
maxbs = td->o.max_bs[ddir];
minbs = td->o.min_bs[ddir];
maxbs = td->o.max_bs[ddir];
@@
-680,7
+678,7
@@
static void set_rw_ddir(struct thread_data *td, struct io_u *io_u)
void put_file_log(struct thread_data *td, struct fio_file *f)
{
void put_file_log(struct thread_data *td, struct fio_file *f)
{
- int ret = put_file(td, f);
+
unsigned
int ret = put_file(td, f);
if (ret)
td_verror(td, ret, "file close");
if (ret)
td_verror(td, ret, "file close");
@@
-1102,7
+1100,7
@@
out:
static struct fio_file *get_next_file(struct thread_data *td)
{
static struct fio_file *get_next_file(struct thread_data *td)
{
- if (
!(td->flags & TD_F_PROFILE_OPS)
) {
+ if (
td->flags & TD_F_PROFILE_OPS
) {
struct prof_io_ops *ops = &td->prof_io_ops;
if (ops->get_next_file)
struct prof_io_ops *ops = &td->prof_io_ops;
if (ops->get_next_file)
@@
-1297,7
+1295,7
@@
int queue_full(struct thread_data *td)
struct io_u *__get_io_u(struct thread_data *td)
{
struct io_u *__get_io_u(struct thread_data *td)
{
- struct io_u *io_u;
+ struct io_u *io_u
= NULL
;
td_io_u_lock(td);
td_io_u_lock(td);
@@
-1490,7
+1488,8
@@
struct io_u *get_io_u(struct thread_data *td)
if (td->flags & TD_F_REFILL_BUFFERS) {
io_u_fill_buffer(td, io_u,
io_u->xfer_buflen, io_u->xfer_buflen);
if (td->flags & TD_F_REFILL_BUFFERS) {
io_u_fill_buffer(td, io_u,
io_u->xfer_buflen, io_u->xfer_buflen);
- } else if (td->flags & TD_F_SCRAMBLE_BUFFERS)
+ } else if ((td->flags & TD_F_SCRAMBLE_BUFFERS) &&
+ !(td->flags & TD_F_COMPRESS))
do_scramble = 1;
if (td->flags & TD_F_VER_NONE) {
populate_verify_io_u(td, io_u);
do_scramble = 1;
if (td->flags & TD_F_VER_NONE) {
populate_verify_io_u(td, io_u);
@@
-1568,7
+1567,7
@@
static void account_io_completion(struct thread_data *td, struct io_u *io_u,
unsigned long tusec;
tusec = utime_since(&io_u->start_time, &icd->time);
unsigned long tusec;
tusec = utime_since(&io_u->start_time, &icd->time);
- add_lat_sample(td, idx, tusec, bytes);
+ add_lat_sample(td, idx, tusec, bytes
, io_u->offset
);
if (td->flags & TD_F_PROFILE_OPS) {
struct prof_io_ops *ops = &td->prof_io_ops;
if (td->flags & TD_F_PROFILE_OPS) {
struct prof_io_ops *ops = &td->prof_io_ops;
@@
-1586,7
+1585,7
@@
static void account_io_completion(struct thread_data *td, struct io_u *io_u,
}
if (!td->o.disable_clat) {
}
if (!td->o.disable_clat) {
- add_clat_sample(td, idx, lusec, bytes);
+ add_clat_sample(td, idx, lusec, bytes
, io_u->offset
);
io_u_mark_latency(td, lusec);
}
io_u_mark_latency(td, lusec);
}
@@
-1595,9
+1594,6
@@
static void account_io_completion(struct thread_data *td, struct io_u *io_u,
if (!gtod_reduce(td))
add_iops_sample(td, idx, bytes, &icd->time);
if (!gtod_reduce(td))
add_iops_sample(td, idx, bytes, &icd->time);
-
- if (td->o.number_ios && !--td->o.number_ios)
- td->done = 1;
}
static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
}
static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
@@
-1626,8
+1622,15
@@
static void io_completed(struct thread_data *td, struct io_u *io_u,
* Mark IO ok to verify
*/
if (io_u->ipo) {
* Mark IO ok to verify
*/
if (io_u->ipo) {
- io_u->ipo->flags &= ~IP_F_IN_FLIGHT;
- write_barrier();
+ /*
+ * Remove errored entry from the verification list
+ */
+ if (io_u->error)
+ unlog_io_piece(td, io_u);
+ else {
+ io_u->ipo->flags &= ~IP_F_IN_FLIGHT;
+ write_barrier();
+ }
}
td_io_u_unlock(td);
}
td_io_u_unlock(td);
@@
-1820,7
+1823,8
@@
void io_u_queued(struct thread_data *td, struct io_u *io_u)
unsigned long slat_time;
slat_time = utime_since(&io_u->start_time, &io_u->issue_time);
unsigned long slat_time;
slat_time = utime_since(&io_u->start_time, &io_u->issue_time);
- add_slat_sample(td, io_u->ddir, slat_time, io_u->xfer_buflen);
+ add_slat_sample(td, io_u->ddir, slat_time, io_u->xfer_buflen,
+ io_u->offset);
}
}
}
}