From: Jens Axboe Date: Thu, 9 Oct 2014 19:27:44 +0000 (-0600) Subject: stat: add dropped ios to the standard output X-Git-Tag: fio-2.1.14~77 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=3bcb9d945bf8859cfcca50a2899b1af6ae849c02;ds=sidebyside stat: add dropped ios to the standard output Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index 66f982c0..1879e447 100644 --- 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]); + 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 eb72e2ee..30f66470 100644 --- a/engines/net.c +++ b/engines/net.c @@ -30,7 +30,6 @@ struct netio_data { 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 @@ static void store_udp_seq(struct netio_data *nd, struct io_u *io_u) 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 @@ 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) - 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 @@ 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) - verify_udp_seq(nd, io_u); + verify_udp_seq(td, nd, io_u); return ret; } diff --git a/server.c b/server.c index fa029ca3..33c512c7 100644 --- 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]); + 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 89d71946..536d5a9c 100644 --- 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," - " 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 @@ 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]; + 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 @@ 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; + ts->drop_io_u[i] = 0; } } diff --git a/stat.h b/stat.h index 90a7fb31..1727c0c8 100644 --- 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]; + uint64_t drop_io_u[3]; uint64_t total_submit; uint64_t total_complete;