stat: add dropped ios to the standard output
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/client.c b/client.c
index 66f982c..1879e44 100644
--- a/client.c
+++ b/client.c
@@ -831,6 +831,7 @@
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
dst->total_io_u[i] = le64_to_cpu(src->total_io_u[i]);
dst->short_io_u[i] = le64_to_cpu(src->short_io_u[i]);
+ dst->drop_io_u[i] = le64_to_cpu(src->drop_io_u[i]);
}
dst->total_submit = le64_to_cpu(src->total_submit);
diff --git a/engines/net.c b/engines/net.c
index eb72e2e..30f6647 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -30,7 +30,6 @@
struct sockaddr_in addr;
struct sockaddr_in6 addr6;
struct sockaddr_un addr_un;
- uint64_t udp_lost;
uint64_t udp_send_seq;
uint64_t udp_recv_seq;
};
@@ -488,7 +487,8 @@
us->seq = cpu_to_le64(nd->udp_send_seq++);
}
-static void verify_udp_seq(struct netio_data *nd, struct io_u *io_u)
+static void verify_udp_seq(struct thread_data *td, struct netio_data *nd,
+ struct io_u *io_u)
{
struct udp_seq *us;
uint64_t seq;
@@ -500,7 +500,7 @@
seq = le64_to_cpu(us->seq);
if (seq != nd->udp_recv_seq)
- nd->udp_lost += seq - nd->udp_recv_seq;
+ td->ts.drop_io_u[io_u->ddir] += seq - nd->udp_recv_seq;
nd->udp_recv_seq = seq + 1;
}
@@ -615,7 +615,7 @@
} while (1);
if (is_udp(o) && td->o.verify == VERIFY_NONE)
- verify_udp_seq(nd, io_u);
+ verify_udp_seq(td, nd, io_u);
return ret;
}
diff --git a/server.c b/server.c
index fa029ca..33c512c 100644
--- a/server.c
+++ b/server.c
@@ -1066,6 +1066,7 @@
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
p.ts.total_io_u[i] = cpu_to_le64(ts->total_io_u[i]);
p.ts.short_io_u[i] = cpu_to_le64(ts->short_io_u[i]);
+ p.ts.drop_io_u[i] = cpu_to_le64(ts->drop_io_u[i]);
}
p.ts.total_submit = cpu_to_le64(ts->total_submit);
diff --git a/stat.c b/stat.c
index 89d7194..536d5a9 100644
--- a/stat.c
+++ b/stat.c
@@ -574,13 +574,17 @@
io_u_dist[3], io_u_dist[4],
io_u_dist[5], io_u_dist[6]);
log_info(" issued : total=r=%llu/w=%llu/d=%llu,"
- " short=r=%llu/w=%llu/d=%llu\n",
+ " short=r=%llu/w=%llu/d=%llu,"
+ " drop=r=%llu/w=%llu/d=%llu\n",
(unsigned long long) ts->total_io_u[0],
(unsigned long long) ts->total_io_u[1],
(unsigned long long) ts->total_io_u[2],
(unsigned long long) ts->short_io_u[0],
(unsigned long long) ts->short_io_u[1],
- (unsigned long long) ts->short_io_u[2]);
+ (unsigned long long) ts->short_io_u[2],
+ (unsigned long long) ts->drop_io_u[0],
+ (unsigned long long) ts->drop_io_u[1],
+ (unsigned long long) ts->drop_io_u[2]);
if (ts->continue_on_error) {
log_info(" errors : total=%llu, first_error=%d/<%s>\n",
(unsigned long long)ts->total_err_count,
@@ -1123,9 +1127,11 @@
if (!dst->unified_rw_rep) {
dst->total_io_u[k] += src->total_io_u[k];
dst->short_io_u[k] += src->short_io_u[k];
+ dst->drop_io_u[k] += src->drop_io_u[k];
} else {
dst->total_io_u[0] += src->total_io_u[k];
dst->short_io_u[0] += src->short_io_u[k];
+ dst->drop_io_u[0] += src->drop_io_u[k];
}
}
@@ -1658,6 +1664,7 @@
for (i = 0; i < 3; i++) {
ts->total_io_u[i] = 0;
ts->short_io_u[i] = 0;
+ ts->drop_io_u[i] = 0;
}
}
diff --git a/stat.h b/stat.h
index 90a7fb3..1727c0c 100644
--- a/stat.h
+++ b/stat.h
@@ -160,6 +160,7 @@
uint32_t io_u_plat[DDIR_RWDIR_CNT][FIO_IO_U_PLAT_NR];
uint64_t total_io_u[3];
uint64_t short_io_u[3];
+ uint64_t drop_io_u[3];
uint64_t total_submit;
uint64_t total_complete;