X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=70f9e0a1d75e24e5b355e1e9e58078351d364a1a;hp=98b9ad2f8ffffbc229e38aa941fcd4cfda31ce4c;hb=3d43382c7864753728b181ac356222d67bdd4a3f;hpb=b29ad56266faa33326de00e315d2b34b735fb028 diff --git a/stat.c b/stat.c index 98b9ad2f..70f9e0a1 100644 --- a/stat.c +++ b/stat.c @@ -114,11 +114,9 @@ static int double_cmp(const void *a, const void *b) return cmp; } -static unsigned int calc_clat_percentiles(unsigned int *io_u_plat, - unsigned long nr, fio_fp64_t *plist, - unsigned int **output, - unsigned int *maxv, - unsigned int *minv) +unsigned int calc_clat_percentiles(unsigned int *io_u_plat, unsigned long nr, + fio_fp64_t *plist, unsigned int **output, + unsigned int *maxv, unsigned int *minv) { unsigned long sum = 0; unsigned int len, i, j = 0; @@ -287,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; @@ -329,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); } @@ -474,8 +468,14 @@ 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(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); + show_lat_u(io_u_lat_u); show_lat_m(io_u_lat_m); } @@ -485,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])) @@ -510,9 +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); - stat_calc_lat_u(ts, io_u_lat_u); - stat_calc_lat_m(ts, io_u_lat_m); - show_latencies(io_u_lat_u, io_u_lat_m); + show_latencies(ts); runtime = ts->total_run_time; if (runtime) { @@ -960,6 +956,11 @@ void show_run_stats(void) else memset(ts->description, 0, FIO_JOBNAME_SIZE); + /* + * If multiple entries in this group, this is + * the first member. + */ + ts->thread_number = td->thread_number; ts->groupid = td->groupid; /*