X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=stat.c;h=8b032b881d93d8fe1dc692a1c38898be42848bcd;hb=2b0898923ad51ef5d0a84826c391b889675e57fa;hp=40ca1d3881e4cf2d0f1552549c509d8361118b84;hpb=a269790cd25788dd4226641a3ceab1b3c8fda14b;p=fio.git diff --git a/stat.c b/stat.c index 40ca1d38..8b032b88 100644 --- a/stat.c +++ b/stat.c @@ -285,11 +285,7 @@ void show_group_stats(struct group_run_stats *rs) } } -#define ts_total_io_u(ts) \ - ((ts)->total_io_u[0] + (ts)->total_io_u[1]) - -static void stat_calc_dist(unsigned int *map, unsigned long total, - double *io_u_dist) +void stat_calc_dist(unsigned int *map, unsigned long total, double *io_u_dist) { int i; @@ -327,12 +323,12 @@ static void stat_calc_lat(struct thread_stat *ts, double *dst, } } -static void stat_calc_lat_u(struct thread_stat *ts, double *io_u_lat) +void stat_calc_lat_u(struct thread_stat *ts, double *io_u_lat) { stat_calc_lat(ts, io_u_lat, ts->io_u_lat_u, FIO_IO_U_LAT_U_NR); } -static void stat_calc_lat_m(struct thread_stat *ts, double *io_u_lat) +void stat_calc_lat_m(struct thread_stat *ts, double *io_u_lat) { stat_calc_lat(ts, io_u_lat, ts->io_u_lat_m, FIO_IO_U_LAT_M_NR); } @@ -472,9 +468,11 @@ static void show_lat_m(double *io_u_lat_m) show_lat(io_u_lat_m, FIO_IO_U_LAT_M_NR, ranges, "msec"); } -static void show_latencies(struct thread_stat *ts, double *io_u_lat_u, - double *io_u_lat_m) +static void show_latencies(struct thread_stat *ts) { + double io_u_lat_u[FIO_IO_U_LAT_U_NR]; + double io_u_lat_m[FIO_IO_U_LAT_M_NR]; + stat_calc_lat_u(ts, io_u_lat_u); stat_calc_lat_m(ts, io_u_lat_m); @@ -487,8 +485,6 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs) double usr_cpu, sys_cpu; unsigned long runtime; double io_u_dist[FIO_IO_U_MAP_NR]; - double io_u_lat_u[FIO_IO_U_LAT_U_NR]; - double io_u_lat_m[FIO_IO_U_LAT_M_NR]; if (!(ts->io_bytes[0] + ts->io_bytes[1]) && !(ts->total_io_u[0] + ts->total_io_u[1])) @@ -512,7 +508,7 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs) if (ts->io_bytes[DDIR_WRITE]) show_ddir_status(rs, ts, DDIR_WRITE); - show_latencies(ts, io_u_lat_u, io_u_lat_m); + show_latencies(ts); runtime = ts->total_run_time; if (runtime) {