stat: add dropped ios to the standard output
authorJens Axboe <axboe@fb.com>
Thu, 9 Oct 2014 19:27:44 +0000 (13:27 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 9 Oct 2014 19:27:44 +0000 (13:27 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
client.c
engines/net.c
server.c
stat.c
stat.h

index 66f982c0f5010525dfb5dfcfb19fe82c7552e17d..1879e4478e5d6bcf1926c42b026b7176af195bb8 100644 (file)
--- a/client.c
+++ b/client.c
@@ -831,6 +831,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        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]);
        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);
        }
 
        dst->total_submit       = le64_to_cpu(src->total_submit);
index eb72e2eee389857346c22cbe376f1c0c7fe36c9a..30f66470185e97b4c224f344d0a4cc118add98ff 100644 (file)
@@ -30,7 +30,6 @@ struct netio_data {
        struct sockaddr_in addr;
        struct sockaddr_in6 addr6;
        struct sockaddr_un addr_un;
        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;
 };
        uint64_t udp_send_seq;
        uint64_t udp_recv_seq;
 };
@@ -488,7 +487,8 @@ static void store_udp_seq(struct netio_data *nd, struct io_u *io_u)
        us->seq = cpu_to_le64(nd->udp_send_seq++);
 }
 
        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;
 {
        struct udp_seq *us;
        uint64_t seq;
@@ -500,7 +500,7 @@ static void verify_udp_seq(struct netio_data *nd, struct io_u *io_u)
        seq = le64_to_cpu(us->seq);
 
        if (seq != nd->udp_recv_seq)
        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;
 }
 
        nd->udp_recv_seq = seq + 1;
 }
@@ -615,7 +615,7 @@ static int fio_netio_recv(struct thread_data *td, struct io_u *io_u)
        } while (1);
 
        if (is_udp(o) && td->o.verify == VERIFY_NONE)
        } 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;
 }
 
        return ret;
 }
index fa029ca3bc3856fa212ad790349f5e3ee6a83f78..33c512c78f96a5d19cd0f110b6d418d581ad1357 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1066,6 +1066,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        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]);
        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);
        }
 
        p.ts.total_submit       = cpu_to_le64(ts->total_submit);
diff --git a/stat.c b/stat.c
index 89d719468cd91aed185a3491e08cb1a1fe7d8313..536d5a9c000449675caa36f8a4d998b79f58bb82 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -574,13 +574,17 @@ static void show_thread_status_normal(struct thread_stat *ts,
                                        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,"
                                        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->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,
        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 @@ void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src, int nr)
                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];
                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];
                } 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 @@ void reset_io_stats(struct thread_data *td)
        for (i = 0; i < 3; i++) {
                ts->total_io_u[i] = 0;
                ts->short_io_u[i] = 0;
        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 90a7fb31a1bc2bba6fc43af8b509481918ab1a0c..1727c0c8ca013efa6654fb75952241ef6cbf88ec 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -160,6 +160,7 @@ struct thread_stat {
        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];
        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;
 
        uint64_t total_submit;
        uint64_t total_complete;